Loading ...
Sorry, an error occurred while loading the content.

46061Re: [libertybasic] Re: Passing / Receiving large (64bit) parameters in API Calls

Expand Messages
  • Stefan Pendl
    Jan 21, 2013
    • 0 Attachment
      Am 21.01.2013 17:52, schrieb mike_collins_23:
      > Hi Stefan,
      >
      > I think I understand your example, at least in terms of passing pointers to the structures. I didn't really understand the "GetProcAddress" part and what the different values for "pGetDiskFreeSpaceEx" meant (don't think it matters for the purpose of our discussion).
      >
      > I still have a problem receiving a 64bit number as the returned value. When I try the following code, Liberty disappears with no error messages:
      >
      > struct ChannelMask,_
      > ChannelMaskLow as ulong,_
      > ChannelMaskHigh as ulong
      >
      > calldll #CAN, "xlGetChannelMask",_
      > hwType as short,_
      > hwIndex as short,_
      > hwChannel as short,_
      > ChannelMask as struct
      >
      > print "xlGetChannelMask = "; ChannelMask.ChannelMaskLow.struct + ChannelMask.ChannelMaskLow.struct * hexdec("&H100000000")
      >
      > Obviously there was some prior code to open the DLL etc. and I have called some other simple functions of this DLL which return with a good status.
      >
      > It behaves OK if I make ChannelMask a Long but presumably I'm not then getting the full return value ?
      >
      > Mike
      >

      A structure is not a valid return type for LB.

      We would need to know how the C declaration of the API function looks
      like to make the correct decision.

      Is there a place on the net where one can download the C header file?


      --
      Stefan Pendl
      http://stefanpendl.runbasichosting.com/

      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

      LB Community Wiki .............. http://basic.wikispaces.com/
      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

      Books at http://www.lulu.com/ and http://www.amazon.com/
      Alyce Watson ... APIs for Liberty BASIC
      Carl Gundel .... Beginning Programming with Liberty BASIC

      Windows 7 Home Premium 64-bit SP1
      AMD Turion X2 RM-70 2GHz, 4GB RAM
    • Show all 9 messages in this topic