Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX question ...

Status
Not open for further replies.

HadiRezaee

Technical User
Mar 9, 2001
165
IR
Hi all,
I wanna write new Method for my ActiveX, like this:

LPCSTR GetText();

But in Class Wizard i can't write new Method with LPCSTR return value !!!
Can i change it in my source code ?
 
Hello,

I don't know Active-X-controls, but I think they are similar to a COM-server-dll (derived from IDispatch)... so I would try to declare the function as an Get-Method (of the properties your control contain) an change the LPCSTR for a BSTR (I think it works this way GetText [out, retval]BSTR *pbstr). I'm not quite shure if you have to use [in] instead...

I hope this is a hint...
 
Ditto on DonEsteban's advice. I too only know COM but I understand ActiveX is based on COM. I hesitated to answer in case someone knew that it was possible to do this in an ActiveX control.

In COM you can only return an HRESULT from a method. Anything else has to be a property and even then you are limite to BSTR types but these are easily convertible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top