calling a c# dll with vb6
Hi all!
I'm really new to vb6 and have some knowledge of C# and would like to create a vb6 program that calls a C# dll but I've found a huge problem which is, I always get a "dll runtime error 453".
I've been googling for some hours and can't find the solution for this problem...
please help.
thanks a lot
B33bs
(here's the code sample... it's just an example)
Private Declare Function func Lib "C:\Documents and Settings\...\dllnewAtt.dll" () As String
Private Sub Command1_Click()
Dim nSpeed As String
nSpeed = func()
Form1.Text1.Text = nSpeed
End Sub
naura paxPosted Nov 10, 2009, 5:42 AM
here you'll have to register it using "regasm /tlb:PhysServer2.tlb PhysServer2.dll" and then add the assebly to global assembly cache using "gacutil /I PhysServer2.dll"
Later on you'll find the dll is in Available References list in Project->Reference
you'll just have to select it and create an object of the class in dll type library.
MiguelPosted Nov 10, 2009, 6:42 AM
MiguelPosted Nov 10, 2009, 6:24 AM
MiguelPosted Nov 10, 2009, 5:38 AM
naura paxPosted Nov 10, 2009, 5:32 AM
you will have to use com callable wrapper for that purpose. It requires a lot of steps to be followed to be used successfully.
follow this link and read the article carefully to get better answer.
http://msdn.microsoft.com/hi-in/library/ms973802(en-us).aspx