Wednesday, April 20, 2011

How to use vb6 components in .NET

as we all know vb6 components work on STA and .NET works on MTA.

To use vb6 dll in .net we will have to follow below steps.
- first create dll in vb6.
- you need to register the DLL. Select the Start menu's Run command and execute the statement:

regsvr32 VB6Project.dll

-Next start a Visual Basic .NET project. Select the Project menu's Add Reference command. Click the COM tab and find the DLL or click the Browse button to select it. Now the .NET application can use the DLL's public classes as we use .net classes. i mean just create its object and call its function with object.function();

http://dotnetacademy.blogspot.com/2011/04/explain-sta-and-mta.html

http://blogs.msdn.com/b/robgruen/archive/2004/11/09/254602.aspx

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates