Click to See Complete Forum and Search --> : How to get an ATL ActiveX control working in IE?


Arthur
January 19th, 2006, 10:23 AM
Hello,

I created a simple ATL ActiveX control, with one property on the interface:
Url. It is added by clicking some wizard stuf an it creates the following

The IDL describes it as follows:

[propget, id(1), helpstring("property URL")] HRESULT URL([out, retval] BSTR* pVal);

[propput, id(1), helpstring("property URL")] HRESULT URL([in] BSTR newVal);

As well as 2 methods:

STDMETHOD(get_URL)(BSTR* pVal);
STDMETHOD(put_URL)(BSTR newVal);

Now, if I call the interface like this in VBScript:

Dim object
Set object = CreateObject("ActiveXTest.testje.1")
object.URL = "http://www.codeguru.com"

My fantastic ATL ActiveX control URL property is invoked!

If I do this in IE:

<OBJECT ID="INXT_ActiveX" WIDTH="100%" HEIGHT="100%" CLASSID="CLSID:83CD4A17-89ED-4B7D-A654-22F8E4D6CD0A">
<PARAM NAME="Url" VALUE="http://www.codeguru.com">
</OBJECT>

The Url property is not set.

Could someone tell me what I am doing wrong here?

Thanks in advance,
Arthur

kirants
January 19th, 2006, 01:01 PM
Is it case sensitive in any way ?
NAME="Url"
versus
NAME="URL"

Arthur
January 19th, 2006, 02:46 PM
Thanks for your input!
It didn't work, I got the solution from one of the Microsoft NNTP newsgroups:

You have to implement the IPersistenPropertyBag interface (by deriving IPersistentPropertyBagImpl<MyClass>).
So it works.

I wonder why this is needed in IE, since I expose this properties through IDispatch and persisting properties is none of my business. But never mind :)

Anyway, it works.