Hi, can someone help:
I get this error (kind of 'all of a sudden') which I tried to fix by registering the DLL (which gave an error; I learned that PBDLL's don't have to be registered. True / False?).
Anyway, using the code from Dorian (way back in july) didn't help:
FUNCTION LibMain( BYVAL hInstance AS LONG, BYVAL Reason AS LONG, BYVAL Reserved AS LONG) EXPORT AS LONG
FUNCTION = 1
END FUNCTION
And the explicit mentioning of the ALIAS (in caps in both the PBDLL as well as the VB 6.0 project) was not good either.
Here's the code:
PBDLL Code:
#COMPILE DLL "C:\test.dll"
#OPTION VERSION4
DECLARE SUB RunThrough_Order ALIAS "RUNTHROUGH_ORDER" (BYREF Session AS String)
SUB RunThrough_Order ALIAS "RUNTHROUGH_ORDER" (BYREF Session AS String) EXPORT
Session = "All OK"
End Sub
VB Code:
Declare Sub RunThrough_Order Lib "C:\Test.DLL" Alias "RUNTHROUGH_ORDER" (ByRef Session As String)
Sub Test1
Session = "InputString"
Call RunThrough_Order(Session)
Msgbox "Session = " & Session
End Sub
The thing is: if I start VB, open & run my VB project, it provides the 453-error. If I really close VB and open & run the project again, it works alright!
Any ideas what I'm doing wrong?
Hope you can help,
Jeroen
I get this error (kind of 'all of a sudden') which I tried to fix by registering the DLL (which gave an error; I learned that PBDLL's don't have to be registered. True / False?).
Anyway, using the code from Dorian (way back in july) didn't help:
FUNCTION LibMain( BYVAL hInstance AS LONG, BYVAL Reason AS LONG, BYVAL Reserved AS LONG) EXPORT AS LONG
FUNCTION = 1
END FUNCTION
And the explicit mentioning of the ALIAS (in caps in both the PBDLL as well as the VB 6.0 project) was not good either.
Here's the code:
PBDLL Code:
#COMPILE DLL "C:\test.dll"
#OPTION VERSION4
DECLARE SUB RunThrough_Order ALIAS "RUNTHROUGH_ORDER" (BYREF Session AS String)
SUB RunThrough_Order ALIAS "RUNTHROUGH_ORDER" (BYREF Session AS String) EXPORT
Session = "All OK"
End Sub
VB Code:
Declare Sub RunThrough_Order Lib "C:\Test.DLL" Alias "RUNTHROUGH_ORDER" (ByRef Session As String)
Sub Test1
Session = "InputString"
Call RunThrough_Order(Session)
Msgbox "Session = " & Session
End Sub
The thing is: if I start VB, open & run my VB project, it provides the 453-error. If I really close VB and open & run the project again, it works alright!
Any ideas what I'm doing wrong?
Hope you can help,
Jeroen
Comment