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

46064Re: Passing / Receiving large (64bit) parameters in API Calls

Expand Messages
  • mike_collins_23
    Jan 22, 2013
    • 0 Attachment
      Hi Stefan,

      I'm not sure why you wanted me to use Long's to pass the parameters as I believe they should be short. Anyway, whichever I use, if I use a Double for the returned value, Liberty crashes with "Virtual Machine Stack Overflow". If I use a Long for the returned value it doesn't crash.

      Unfortunately I don't think I have got far enough with the program to get a meaningful value returned (when I use a Long it's value is zero).
      I don't want to take up too much of your time so if you think this is too tricky for Liberty I will abandon the idea.

      Mike

      --- In libertybasic@yahoogroups.com, Stefan Pendl wrote:
      >
      > Am 22.01.2013 10:07, schrieb mike_collins_23:
      > >
      > > The relevant part of vxlapi.h is:
      > >
      > > //////////////////////////////////////////////////////////////////////
      > > // For the timestamps and the access mask the API use 64 bit values
      > > typedef unsigned __int64 XLuint64;
      > >
      > > //////////////////////////////////////////////////////////////////////
      > > typedef char *XLstringType;
      > >
      > > //////////////////////////////////////////////////////////////////////
      > > // accessmask
      > > typedef XLuint64 XLaccess;
      > >
      > > //////////////////////////////////////////////////////////////////////
      > >
      > > and of the Driver Manual:
      > >
      > > 3.1.8 xlGetChannelMask
      > > Syntax XLaccess xlGetChannelMask (
      > > int hwType,
      > > int hwIndex,
      > > int hwChannel);
      > > Description Retrieves the channel mask of a particular hardware channel.
      > > Input Parameters „­ hwType
      > > Required to distinguish the different hardware types, e.g.
      > > - -1
      > > - XL_HWTYPE_CANCARDXL
      > > - XL_HWTYPE_CANBOARDXL
      > > - ¡K
      > > Parameter -1 can be used if the hardware type does not matter.
      > > „­ hwIndex
      > > Required to distinguish between two or more devices of the same hardware
      > > type (-1, 0, 1¡K). Parameter -1 is used to retrieve the first available hardware.
      > > The type depends on hwType.
      > > „­ hwChannel
      > > Required to distinguish the hardware channel of the selected device (-1, 0, 1, ¡K).
      > > Parameter -1 can be used to retrieve the first available channel.
      > > Return Value Returns the channel mask.
      > >
      > > Mike
      > >
      >
      > Could you try the following?
      >
      > '---code start (watch for line wraps)
      >
      > calldll #vxlapi, "xlGetChannelMask", _
      > hwType as long, _
      > hwIndex as long, _
      > hwChannel as long, _
      > accessmask as double
      >
      > '---code end
      >
      > If that works, then we could try to convert the double value similar to
      > the VarR4FromR8 example at
      > http://www.b6sw.com/forum/content.php?mode=hints&t=223 , but using
      > VarUI8FromR8 at
      > http://msdn.microsoft.com/en-us/library/windows/desktop/ms644397%28v=vs.85%29.aspx
      >
      >
      > --
      > 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