|
|
|
date: Thu, 19 Jan 2006 16:38:51 +0100,
group: microsoft.public.platformsdk.com_ole
back
How to get an ATL ActiveX control working in IE
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. The control is however rendered in IE.
Could someone tell me what I am doing wrong here?
Thanks in advance,
Arthur
date: Thu, 19 Jan 2006 16:38:51 +0100
author: Arthur Roodenburg
Re: How to get an ATL ActiveX control working in IE
Arthur Roodenburg wrote:
> 1) What does IPeristPropertyBag has to do with my (in principle) non
> persistent Url propertie that is exposed through IDispatch?
IE feeds the contents of <param> tags to the object via
IPersistPropertyBag. If the object does not implement one, it cannot see
its <param> values.
ATL's IPersistPropertyBagImpl implements IPersistPropertyBag::Load as
follows: it walks the property map, for each property checks whether it
is present in the bag, and if so reads the value from the bag and
executes property put on your object's IDispatch implementation.
> 2) Why IE does it through this other interface?
What other interface?
> 3) After al those years I can't rely on the fact that if I create an
> ActiveX control in ATL it actually does what I expect?
Is it a question or a statement? May it be that your expectations were
wrong?
There is theoretical research into a new computer architecture that
would ensure programs always meet expectations. A computer in this
architecture would have just one machine instruction, DWIM (stands for
Do What I Mean). Unfortunately, this research is very far from fruition.
Or perhaps it's fortunate, because the moment such computers are
released you and I would be out of jobs.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Thu, 19 Jan 2006 11:46:09 -0500
author: Igor Tandetnik
|
|