Hi all,
I have a DLL developed using the previous version of VB(Or C++). How can I able to use that dll in my vb.net appilcation ?
I can able to get the method using that dll in vb application :)
Thanks
Dana
Printable View
Hi all,
I have a DLL developed using the previous version of VB(Or C++). How can I able to use that dll in my vb.net appilcation ?
I can able to get the method using that dll in vb application :)
Thanks
Dana
If it's a COM component then you simply reference it as though it was a .NET assembly. The IDE will generate an Interop assembly, which is a .NET assembly, that actually talks to the COM component.
If the library exports functions then you just import them exactly as you do for Windows API functions. The DLL will need to be in the same folder as your EXE or in the system32 folder (or equivalent).
Thanks for the reply Jhon. I already did the first option and it gave the error as
http://support.microsoft.com/kb/814197
I am working on that ...
You can also use CreateObject approach like this:
I created a Active-X library project named TestLibrary1 in VB6 having Class1 which contains SayHello method that simply display a greet message.
e.g. Hello Deepak!
Now in .NET I create I create the object of that vb6 library in run-time.
Code:Public Class Form1
Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles Me.Load
Dim obj As Object = CreateObject("TestLibrary1.Class1")
obj.SayHello("Deepak")
End Sub
End Class