DLL.CallFunction - passing values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Derek
    Indigo Rose Customer
    • May 2001
    • 1254

    DLL.CallFunction - passing values

    Quick question coz this is doing my nut in ...

    I need to pass a bunch of variables to a dll but i cant truncate a boolean value - Grrr!

    How does one get around this?

    thus far:
    DLL.CallFunction("...file32.DLL", "functionName", "\""..variable1.."\",\""..variable2.."\",\""..false.."\",\""..ENCODING_AUTO.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
    this bit is the problem -- \""..false.."\",\""..ENCODING_AUTO.."\""
    .
    .
    .
    false needs to be true or false so it cant be a quoted string, coz that doesnt work. But i cant truncate the boolean value coz that doesnt work either!
    And ENCODING_AUTO needs to be exactly as written but cant be a quoted string coz that doesnt work.

    Suggestions, oh wise ones?
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]
  • Ulrich
    Indigo Rose Staff Member
    • Apr 2005
    • 5131

    #2
    I'll try to help here, but I may not be one of the wise ones, so take my input with a grain of salt... Normally, boolean true can be replaced with 1, while false is 0. Worth a try.

    As for the ENCODING_AUTO, this looks like a numerical value as well. You just have to find out to which value this definition corresponds, which normally can be found in the documentation (or the header file) of the library / dll you are using. If it is the default setting, chances are that it corresponds to 0.

    As both arguments are values, don't place quotes around them.

    Ulrich

    Comment

    • Derek
      Indigo Rose Customer
      • May 2001
      • 1254

      #3
      I did get it working in the end. I quoted the 'string' of params as a whole then cut off the variables early to accomodate the last 2 values. I thought i had tried this and it didnt work .. i guess there was a typo somewhere.
      I actually copied an old line from somewhere and adjusted the code (not always a good idea) so that prob didnt help.

      But i just tried your suggestion and that also worked, so that's worth noting for the future. :yes
      Thanks, Ulrich!
      -
      = Derek
      ["All glory comes from daring to begin" - fortune cookie]

      Comment

      Working...
      X