JohnnyKnoxville
asked on
Passing Data from C# to VB6 Active X control (and vice versa)
I have an active X control written in VB6. I am creating a C# project and need to pass data back and forth to the active x control. Cant I just add the VB6 control to C# project reference and then be able to see public methods and send data over? Is this possible? What packages are needed to do this? COM.Interop?
Please help as soon as possible.
thx,
Knoxxx
Please help as soon as possible.
thx,
Knoxxx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If I simply use..
MyActiveXControl myCtrl = new MyActiveXControl();
This will give me a new instance. What I need is the existing handle to the instance when it loaded in the 3rd party app. I need to be able to populate data into the VB6 controls (text box , combobox, etc)
I tried to create a handle to the user control using CopyMemory and expose it in a public class.
Now I try this in C#...
MyActiveXControl.clsEventM
myCtrl.PassDataToTextBox("
This throws an error:
Retrieving the COM class Factory for component with CLSID -{21301F0D-E249-4906-9D85-
Im completely stuck. Im beginning to think its not possible to pass data back and forth because I cant get the original handle. Is there a way to get a list of active window handles and look for my active x control? Then try to grab it that way?