I have written a DLL in PowerBasic that I want to be accessible from a VB application. If I create a function call in the DLL, I have no problems with calling that function from VB. If I change the function to a Sub Routine, I always receive an error in VB stating:
Here is the PB code:
Function -- Works Fine
Sub -- Does NOT work .. Generates Error
Here is the VB code:
Any ideas or suggestions?
Andrew Peskin
[email protected]
------------------
Code:
Runtime Error ‘453' Can't find entry DLL entry point MyCall in D:\TestCall.DLL
Function -- Works Fine
Code:
#COMPILE DLL "D:\TestCall.DLL" '// Compile to DLL rather than EXE #DIM ALL '// Forced to declare variables before use #DEBUG ERROR OFF '// Use to Toggle Error FUNCTION MyCall ALIAS "MyCall" (BYVAL L1 AS LONG, BYREF L2 AS LONG) EXPORT AS INTEGER L2 = L1 END FUNCTION
Code:
#COMPILE DLL "D:\TestCall.DLL" '// Compile to DLL rather than EXE #DIM ALL '// Forced to declare variables before use #DEBUG ERROR OFF '// Use to Toggle Error SUB MyCall ALIAS "MyCall" (BYVAL L1 AS LONG, BYREF L2 AS LONG) L2 = L1 END SUB
Code:
Private Declare Sub MyCall Lib "D:\TestCall.DLL" (ByVal L1 As Long, ByRef L1 As Long) Private Sub Command1_Click() Dim yy As Integer Dim LL1 As Long Dim LL2 As Long LL1 = 10 LL2 = 15 Call MyCall(LL1, LL2) End Sub
Any ideas or suggestions?
Andrew Peskin
[email protected]
------------------
Comment