Import old DLL to C# .Net
-
Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.
Best Regards, Reza Shojaee
-
Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.
Best Regards, Reza Shojaee
-
I tried with COM tab but VS doesn't accept it
Best Regards, Reza Shojaee
-
I tried with COM tab but VS doesn't accept it
Best Regards, Reza Shojaee
Do you receive some sort or Error ?
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
I tried with COM tab but VS doesn't accept it
Best Regards, Reza Shojaee
Then it's not a COM-based .DLL. You'll have to use P/Invoke to get at the functions it exposes. I hope you have all the documentation on the functions because, if you don't, you're going to find it nearly impossible to call the functions in the .DLL.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.
Best Regards, Reza Shojaee
You need to look up interop services. You can use tlbimp.exe to generate your interop if it is COM (which from the post above seems not to be the case). Otherwise, you can use the DLLImport attribute and reference the functions this way. You will find it tricky to figure out the proper types to use in the function signature, so you need to research a little. But, this is your start.
[DllImport("TheCplusplus.dll")]
static extern uint BTSeparateItems([In, MarshalAs(UnmanagedType.BStr)] string filePath, out object obj);