473,216 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 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 2637
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: beliavsky | last post by:
Many of my C++ programs have the line using namespace std; but the "Accelerated C++" book of Koenig and Moo has many examples where the library names are included one at a time, for example ...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
12
by: Calum Grant | last post by:
In older C++ computer books, you'll often see using namespace std; even in my 1996 copy of Stroustrup. Nowadays, it seems to be considered better to qualify names to make it clearer what...
0
by: canasdaq | last post by:
Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
3
by: John Spiegel | last post by:
Hi All, I've been working on building a .dll in C# (framework 1.1) and using it in VFP8. As always, the example that runs so smoothly in the article fails at a rather basic point in practice. ...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.