Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie Query - How do I pass params from HTML to an ActiveX Control thru the OBJECT Tag?

2 views
Skip to first unread message

Varun Singh

unread,
Aug 24, 2004, 12:35:24 PM8/24/04
to
Hi there,
I know this might be really basic but I couldn't find any info
on it anywhere!! I have an ActiveX Object to which I need to pass params
from the HTML page it is embedded in. I just can't figure out how to get
these values within my AX code. I am using ATL COM Wizard to create the AX.
It has IDispatch implemented and Connection Point too. Calls to AX methods
from Javascript are working perfectly. I have tried to use both to allow the
PARAM tag to set values. What do I need to do to get this working???

Any help, tips or suggestions will be most appreciated!

Thanks in advance,
Regards,
Varun


jeong, seong-tae

unread,
Aug 31, 2004, 3:37:27 AM8/31/04
to
You have to implement IPersistPropetyBag interface.

It's the key of PARAM Tags.

about ATL Example,

1. derive your class with IPersistPropertyBagImpl<YourClass>

2. Implement Load Method like below.

STDMETHOD(Load)( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
{
CComVariant vtVar;
HRESULT hr;

vtVar.vt = VT_I4;
hr = pPropBag->Read( L"PARAMKEYSTRING", &vtVar, pErrorLog );

return S_OK;
}

It will satisfy your needs. ^^

--
======= .NETXpert ==========
url : http://www.dotnetxpert.com
eml : ke...@dotnetxpert.com
msn: kevi...@magicn.com

MCSD.NET
==========================

"Varun Singh" <va...@nospam.net> wrote in message
news:##eBWffiE...@tk2msftngp13.phx.gbl...

Russ

unread,
Sep 1, 2004, 1:02:29 PM9/1/04
to
This kind of thing (writing an ActiveX control for IE and interfacing
to an HTML page to get parameters) is exactly what I need to do. But
I have been unable to find any examples or documentation that tell me
how to proceed. I can write ActiveX, but how do you get IE to load
it, and how do you programmatically access it from the web page? I
want a user click on a button in the page to cause the ActiveX control
to be called and the selected parameters to either be passed or
accessible from within the control.

I'd appreciate pointers to documentation or sample code.

Thanks much, Russ

PS: The original message was posted to 3 news groups, and so I am
posting back to the same 3 groups to try to reach knowledgable people.
So if you have an answer for me, please post at least to
"microsoft.public.windows.inetexplorer.ie5.programming.activexcontrol",
which is the group I am subscribed to. Or you can email me - thanks.

Jeong, seong-tae

unread,
Sep 1, 2004, 8:30:10 PM9/1/04
to

> > 1. derive your class with IPersistPropertyBagImpl<YourClass>
> >
> > 2. Implement Load Method like below.
> >
> > STDMETHOD(Load)( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
> > {
> > CComVariant vtVar;
> > HRESULT hr;
> >
> > hr = pPropBag->Read( L"PARAMKEYSTRING", &vtVar, pErrorLog );
> >
> > return S_OK;
> > }

add COM_INTERFACE_ENTRY for IPersistePropertyBag like this,

BEGIN_COM_MAP(CYourClass)
;
;
COM_INTERFACE_ENTRY( IPersistPropertyBag )
END_COM_MAP()

--
======= (c) .NETXpert ==========

MCSD.NET
==============================

"Varun Singh" <va...@nospam.net> wrote in message

news:u1W$$B1jEH...@TK2MSFTNGP11.phx.gbl...
> Hi Jeong,
> Thanks for the reply! I'll definitely check it out.
>
> Best Regards,
> Varun
>
>
> "jeong, seong-tae" <kev...@hanmail.net.korea> wrote in message
> news:eXbOe1yj...@TK2MSFTNGP12.phx.gbl...

Jeong, seong-tae

unread,
Sep 1, 2004, 8:50:08 PM9/1/04
to
Hi, Russ. ^^

I also have ever had questions like you.
And, All of them was solved with this book, "Programming Microsoft Internet
Explorer 5, Scott Roberts ( Microsoft Press )"

; In addition,I recommend this samples
http://www.microsoft.com/downloads/details.aspx?FamilyID=af0a6060-6566-408f-9f11-ea2c80b8caa0&displaylang=en
you can get the variety of sample sources written with VC++ ATL, although
the most samples is not related to ActiveX Control for IE directly.

have a good day! ^^

--
======= (c) .NETXpert ==========

MCSD.NET
==============================

"Russ" <rus...@eticomm.net> wrote in message
news:fevbj093lrvl6ovee...@4ax.com...

0 new messages