HighTechTalks DotNet Forums  

Re: Wrapped OCX Control]

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Re: Wrapped OCX Control] in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sheng Jiang[MVP]
 
Posts: n/a

Default Re: Wrapped OCX Control] - 12-14-2007 , 06:53 PM






To instantiate an activex control you need a container. AXHost is one for
windows forms.
You first need to use Type.GetTypeFromProgID and Type.GUID to convert the
string name to guid, then call AXHost's constructor with the guid. Finally,
use AXHost's CreateControl method to create the activex after adding the
AXHost objecy to your form's controls collection.


--
Sheng Jiang
Microsoft MVP in VC++
"Alvaro E. Gonzalez Vaquero" <agonzalez (AT) open (DOT) com.co> wrote

Quote:
Hi;

How can I get dynamically (similar to reflection) have access to members
of an object activex
instantiated also so dynamic?


The code of how the ActiveX object is instantiated in this attached file.
ZIP

Tks
Alvaro.






Reply With Quote
  #2  
Old   
Alvaro E. Gonzalez V.
 
Posts: n/a

Default Re: Wrapped OCX Control] - 12-17-2007 , 09:14 AM







Thank you, but now that's what I am doing (please review the attached zip file in the first post).
What I need is to be able to access members of ocx dynamically.

Help me, please...

Sheng Jiang[MVP] wrote:
Quote:
To instantiate an activex control you need a container. AXHost is one for
windows forms.
You first need to use Type.GetTypeFromProgID and Type.GUID to convert the
string name to guid, then call AXHost's constructor with the guid. Finally,
use AXHost's CreateControl method to create the activex after adding the
AXHost objecy to your form's controls collection.



Reply With Quote
  #3  
Old   
Sheng Jiang[MVP]
 
Posts: n/a

Default Re: Wrapped OCX Control] - 12-18-2007 , 02:15 PM



You can discover the methods and properties though IDispatchGetIdsOfNames or
IDispatch::GetTypeInfo


--
Sheng Jiang
Microsoft MVP in VC++
"Alvaro E. Gonzalez V." <agonzalezv (AT) gmail (DOT) com> wrote

Quote:
Thank you, but now that's what I am doing (please review the attached zip
file in the first post).
What I need is to be able to access members of ocx dynamically.

Help me, please...

Sheng Jiang[MVP] wrote:
To instantiate an activex control you need a container. AXHost is one
for
windows forms.
You first need to use Type.GetTypeFromProgID and Type.GUID to convert
the
string name to guid, then call AXHost's constructor with the guid.
Finally,
use AXHost's CreateControl method to create the activex after adding the
AXHost objecy to your form's controls collection.





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.