How to use DLL File Developed in VC++ 6.0 in .Net?

Posted by Hmanjarawala under VB.NET on 8/24/2011 | Points: 10 | Views : 1639 | Status : [Member] | Replies : 2
Hi all,

I've Some Class files which are developed in VC++ 6.0.
I created DLL file from that class files.
Now i want to use that dll files in my VB.net project.

will you plz, guid me how to do so?
i tried to use System.RunTime.InteropServices.DllImportAttribute class, but it can only calls static functions not a member function.
Is there any other alternative way?If so plz give me with some useful code snipets.

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/



Responses

Posted by: Dhirendra on: 8/24/2011 [Member] Starter | Points: 25

Up
0
Down
goto your project and right click on refrence and select add reference menu which show you a dialog box where you see tha COM tab.
find out your dll in the list if it is there then select that dll and click on OK button which causes to generate interop file(in your bin directory after building the project) and this interop will communicate with your COM dll just like proxy.

Please note that if you dont see the dll in COM tab then try to register the DLL using regsvr32 command line
sample command
regsvr32 mycomdll.dll /i


let me know if this helps ..

Hmanjarawala, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 8/24/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi dhirendra,

Thanks for your reply, but i already tried it.
i got following error:
<Dll-name> was loaded, but the DllRegisterServer entry point was not found.
This file can not be registered.

Hope you got this.

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Hmanjarawala, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response