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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Control Based on a CListBox

Status
Not open for further replies.

eastleyd

Technical User
Mar 23, 2004
11
0
0
GB
I have created an ActiveX Control based on a CListBox control. - I did this using the VC++ ActiveX Wizard.

Just a quick and simple question really. How do I access this CListBox from within the actual ActiveX code.

I want to have the ListBox automatically print something in it when it is initialised. But I have no idea what name to reference it by.

I would have thought, that as the control is based on the listbox, I could just call the ListBox's methods (such as AddString etc..) but it appears not.

Could someone let me know how this is done. Or if not, let me know so I can try a different approach.

Thanks :)
 
You should pass a COM interface (IDispatch) that implements the functionality you would like to expose to your ActiveX and pass this one.

Ion Filipski
1c.bmp
 
How do I pass the COM Interface to the ActiveX control?
 
as I understand the ActiveX is implemented by you? In this case it is up to your implementation of the ActiveX. Implement a method that takes a IDispatch* and call this one from the application.

Ion Filipski
1c.bmp
 
I'm not trying to access the CListBox's methods from the actual application. I'm trying to access it's methods from within the Actual ActiveX control.

This is without even usign the control within an application.
 
You should pass a COM interface (IDispatch) that implements the functionality you would like to expose to your ActiveX and pass this one. (look at my first post)


rule:
You can not access directly the CListBox from your ActiveX

Ion Filipski
1c.bmp
 
Rule:
You can not access directly the CListBox from your ActiveX"

-thats pretty silly being that my ActiveX control is based on a CListBox :) oh well, lets not make it a million times more complicated just like everything else in VC++! :)


"You should pass a COM interface (IDispatch) that implements the functionality you would like to expose to your ActiveX and pass this one. (look at my first post)"

I still dont understand how this would be done. - so I need to pass my IDispatch interface - what the applications 'would' see. to my activeX control. - How would it do this?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top