471,605 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Using a VB6 ocx in C# .net

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

Jan 18 '06 #1
1 2539
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<om*********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Jan 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by beliavsky | last post: by
5 posts views Thread by Enos Meroka | last post: by
12 posts views Thread by Calum Grant | last post: by
reply views Thread by canasdaq | last post: by
3 posts views Thread by John Spiegel | last post: by
8 posts views Thread by acb | last post: by
reply views Thread by Eugene Anthony | last post: by
8 posts views Thread by =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.