Announcement

Collapse
No announcement yet.

API Calls Passing Variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • API Calls Passing Variables

    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


    ------------------

  • #2
    Hi Hans (aka "HSB MSCE"),

    I have received your email about this but I have not yet been able to put together any example code for you due to time contraints.

    In the mean time, you need to reregister on this BBS using your _full_ name... handles and aliases are not permitted. Thanks!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X