I am creating an ActiveX control using ATL and trying to expose a property taking a Boolean value. I implemented it as below:
STDMETHOD(get_Visible)(VARIANT_BOOL *pVal);
STDMETHOD(put_Visible)(VARIANT_BOOL newVal);
In the JavaScript function, I call this by the following code:
MyAxCtl.Visible = true;
//MyAxCtl.Visible = "true";
//MyAxCtl.Visible = "TRUE";
//MyAxCtl.Visible = "VARIANT_TRUE";
//MyAxCtl.Visible = -1;
//MyAxCtl.Visible = "-1";
However, none of them works. So, my question is how to expose a Boolean value from ATL ActiveX control to JavaScript.
Moreover, anyone can tells me where can I find any document about communication between ATL types can JavaScript types? I want to find a list of ATL types that can be exposed to JavaScript.
Many thanks,
Shupining
From the code you provider the STDMETHOD’s are correct and the proper JavaScript call for a Boolean is to set it to true.
While I don’t see a case issue with the code you posted, make sure its “Visible” not “visisble”.
When you debug is the ActiveX call being entered?