Hi,
New PowerBasic here.
I am trying to use the folllowing api calls to load a 32 bit dll in 16 bit PBdll16
GetProcAddress(hinstKernel, "LOADLIBRARYEX32W")
GetProcAddress(hinstKernel, "GETPROCADDRESS32W")
GetProcAddress(hinstKernel, "CallProcEx32W")
GetProcAddress(hinstKernel, "FREELIBRARY32W")
I need to be able to use CallProcEx32W to load and call a dll that will use many function with
varying numbers of arguments and types.
I am stuck as to how to define a buffer to receive the data from the api
and then how to get the data out of the buffer
The following is the api call
' Public Declare Function GetShortPathName Lib "kernel32" Alias
' "GetShortPathNameA" (ByVal lpszLongPath As String,
' ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
And this is my function:
FUNCTION pbGetShortPath(BYVAL Drive AS INTEGER) EXPORT AS INTEGER
DIM pathLongText AS ASCIIZ * 256
DIM pathLongPtr AS DWORD
dim pathShortText as ASCIIZ * 256
dim pathShortPTR as DWORD
dim pathBufferSize as integer
dim pathBufferPRT as DWORD
pathLongText = "D:\THISISVERYLONGTEXT.TXT
pathLongPtr = VARPTR(pathLongPtr)
pathShortText=space$(256)
pathShortPTR=VARPTR(pathShortPTR)
pathBufferSize=256
pathBufferPRT=VARPTR(pathBufferSize)
CALL DWORD lpCallProcEx32W CDECL (BYVAL 3???, BYVAL 3???, BYVAL lpGetShortPathNameA, BYVAL pathLongPtr, BYVAL pathShortPTR, byval pathBufferPRT)
'now what to do.
END FUNCTION
I have looked at the sample http://www.powerbasic.com/files/pub/pbdll16/drvtype.zip
but it does not address all my needs
Any help would be appreciated.
Thanks
hans
------------------
New PowerBasic here.
I am trying to use the folllowing api calls to load a 32 bit dll in 16 bit PBdll16
GetProcAddress(hinstKernel, "LOADLIBRARYEX32W")
GetProcAddress(hinstKernel, "GETPROCADDRESS32W")
GetProcAddress(hinstKernel, "CallProcEx32W")
GetProcAddress(hinstKernel, "FREELIBRARY32W")
I need to be able to use CallProcEx32W to load and call a dll that will use many function with
varying numbers of arguments and types.
I am stuck as to how to define a buffer to receive the data from the api
and then how to get the data out of the buffer
The following is the api call
' Public Declare Function GetShortPathName Lib "kernel32" Alias
' "GetShortPathNameA" (ByVal lpszLongPath As String,
' ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
And this is my function:
FUNCTION pbGetShortPath(BYVAL Drive AS INTEGER) EXPORT AS INTEGER
DIM pathLongText AS ASCIIZ * 256
DIM pathLongPtr AS DWORD
dim pathShortText as ASCIIZ * 256
dim pathShortPTR as DWORD
dim pathBufferSize as integer
dim pathBufferPRT as DWORD
pathLongText = "D:\THISISVERYLONGTEXT.TXT
pathLongPtr = VARPTR(pathLongPtr)
pathShortText=space$(256)
pathShortPTR=VARPTR(pathShortPTR)
pathBufferSize=256
pathBufferPRT=VARPTR(pathBufferSize)
CALL DWORD lpCallProcEx32W CDECL (BYVAL 3???, BYVAL 3???, BYVAL lpGetShortPathNameA, BYVAL pathLongPtr, BYVAL pathShortPTR, byval pathBufferPRT)
'now what to do.
END FUNCTION
I have looked at the sample http://www.powerbasic.com/files/pub/pbdll16/drvtype.zip
but it does not address all my needs
Any help would be appreciated.
Thanks
hans
------------------
Comment