Using a VB6 ocx in C# .net

  • Thread starter Thread starter omar.torres
  • Start date Start date
O

omar.torres

Hi all,

Currently I have a VB6 application which uses a custom OCX. To use the
ocx in my VB6 application, I used the following code:

Public MyOCXInstance As OCXobject 'Create a new instance of the OCX
.....
Function read()
Dim MyString as string
MyOCXInstance.read(MyString)
.....'Validate MyString
read=MyString
end Function
....

Function write(byVal S as string)
write = MyOCXInstance.write(S)
end Function



Now I will like to create a C# app base on the same OCX. How can I do
this?
I am new to the C# language so the more details the better! :)
Just in case, I am using .Net 2005.

Thanks in advance for your help,
-Omar
 
Omar,

You should go to your toolbox and select "add new item". A dialog will
come up. If the control is registered on your system, then you can select
the "COM" tab on the dialog that comes up, and add a check to your control.
Once you do that, it will be in your toolbox, and you can just use it at
that point in your apps.

Hope this helps.
 
Back
Top