![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
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. |
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |