Link to home
Start Free TrialLog in
Avatar of ShadowHawk071998
ShadowHawk071998

asked on

ATL ActiveX - Using in HTML pages using <PARAM> Tag

Hi Guys!
I'm getting desperate here. I'm writing an ATL component (Thanks to a few previous questions asked here...). Now it is working great, but I want to insert it into Web pages. Using HTML PARAM tag. (Using VBScripts to load the component and use functions works great, but I don't want to use it because I want a generic component that will work under netscape also!).
anyway. Using PARAM I tried two ways. One is to do this

--

<OBJECT ID="MYCONTROL" WIDTH=470 HEIGHT=62
 CLASSID="CLSID:MYCONTROLCLSID">
 <PARAM NAME="Param1" VALUE="23">
 <PARAM NAME="Param2" VALUE="26">
 </OBJECT>

--

and the other way is to use

<PARAM NAME="Line0001" VALUE="SetSomething(0,1,0)">

which didn't work either.

I was then told I need to implement PropertyBagsImpl. I did it, but that didn't work again. THEN I was told I need to override the load function of the PropertyBagsImpl template.
But this is where I'm stuck. How do I do that? the MSDN states the header to be

HRESULT Read( LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog);

but if I overload it I get an error saying that this declaration differs from the original virtual function by return type or calling convention (or something like that).

What Can I do??? How do I use that LOAD thing, anyway? What are those pointers in the function? Please help...

Thanks!

Ron.
Avatar of jhance
jhance

I didn't realze that Netscape Navigator supported ActiveX controls at all.
Avatar of jkr
>>I didn't realze that Netscape Navigator supported ActiveX
>>controls at all

AFAIK, it doesn't. Does it work with IE?
Avatar of ShadowHawk071998

ASKER

Hmmm.. Good point actually!
I tell you why I thought that VBScript won't work. It's because We need to put that ActiveX inside HTML Help documents (These are HTML documents run inside IE enviroment, I reckon). So will VBSCript work there? If so, it might work after all... :)

Anyway. I'm sure I used ActiveX Inside Netscape. They have a plug-in that enables you to run those controls (I KNOW that Microsoft Investor uses an ActiveX and I always use Netscape!)

Cheers,

Ron.
BTW!!!
OOPS!!!
When I said

HRESULT Read( LPCOLESTR pszPropName, VARIANT* pVar,
                                    IErrorLog* pErrorLog);


I meant

HRESULT Load(
  IPropertyBag* pPropBag,  //Pointer to caller's property bag
  IErrorLog* pErrorLog  //Pointer to error log
);

I need to override the Load and not the Read (From what I gather, the container will call the 'Load' of the control, which then will call the 'Read' to interpret the actual properties from that strange pointer he gets...
 
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi!
This actually worked, although It took me several hours.
The part

hr = pPropBag->Read(L"noItems", &var, pErrorLog);

Didn't work... but I can live without it. I know the parameters.

Just one question, though. At the end you say

IObjectSafetyImpl<CURLTreeView>::SetInterfaceSafetyOptions(riid, dwSupportedOptions, dwEnabledOptions);

Which didn't work for me. Can you please explain and say why I need it? (It works great without it!).

Thanks again!!!

Ron.
Oops. Sorry, but CURLTreeView is my base class from which this code was taken. You don't need to call the base class unless you are deriving from a class that has implements IObjectSafetyImpl.
Oh. Okay. Gotcha.
To finalise things, I guess that

  m_URLs

Is also one of your data members (Some sort of vector thing).

THanks,

Ron.