I've been able to use PBDLL to set up dll's returning values from functions I've written, called from Excel97/VBA. But every time I try to put a regular Kernel32 call in a PBDLL it compiles OK but the call gives a 'File Not found' from Excel. Tests seem to indicate that it's Kernel32 that the Excel call isn't finding. For example, I have the following in my BAS module:
TYPE SYSTEMTIME
wYear AS INTEGER
wMonth AS INTEGER
wDayOfWeek AS INTEGER
wDay AS INTEGER
wHour AS INTEGER
wMinute AS INTEGER
wSecond AS INTEGER
wMilliseconds AS INTEGER
END TYPE
DECLARE SUB GetSystemTime LIB "KERNEL32.DLL" (lpsystemtime AS SYSTEMTIME)
FUNCTION TRYACALL()EXPORT AS INTEGER
DIM Greenwich AS SYSTEMTIME
GetSystemTime Greenwich
TRYACALL = Greenwich.wMinute
END FUNCTION
And the following call from Excel(the declare is correct)
Sub lasttry()
Dim retint As Integer
retint = TRYACALL
MsgBox CStr(retint)
End Sub
This type of call works on my other PBDLL procedures.
I have tried, (I believe) every conceivable capitalization scheme for the DLLs and functions inside them. Dependency walker indicates that the compiled DLL is OK. The DLL is in winnt/system32. Qualified path to it doesn't work either.
So what simple thing am I missing?
TIA-
William Arnold
TYPE SYSTEMTIME
wYear AS INTEGER
wMonth AS INTEGER
wDayOfWeek AS INTEGER
wDay AS INTEGER
wHour AS INTEGER
wMinute AS INTEGER
wSecond AS INTEGER
wMilliseconds AS INTEGER
END TYPE
DECLARE SUB GetSystemTime LIB "KERNEL32.DLL" (lpsystemtime AS SYSTEMTIME)
FUNCTION TRYACALL()EXPORT AS INTEGER
DIM Greenwich AS SYSTEMTIME
GetSystemTime Greenwich
TRYACALL = Greenwich.wMinute
END FUNCTION
And the following call from Excel(the declare is correct)
Sub lasttry()
Dim retint As Integer
retint = TRYACALL
MsgBox CStr(retint)
End Sub
This type of call works on my other PBDLL procedures.
I have tried, (I believe) every conceivable capitalization scheme for the DLLs and functions inside them. Dependency walker indicates that the compiled DLL is OK. The DLL is in winnt/system32. Qualified path to it doesn't work either.
So what simple thing am I missing?
TIA-
William Arnold
Comment