CallDLL with a BOOL Param


Steven Burrows
 

Trying to call a DLL function where the documentation says one of the params is type “BOOL”

Cant see that as an Argument Type in XPA, and try as I might nothing else seems to work. Either Magic gives an error, it crashes, or the DLL fails to work as expected.

(The DLL functions that have recognisable Argument Types are working)

 

Steven Burrows

 


Frederik Soete
 

Hi Steven,

Wild ass guess, have you tried pretending it's an integer equal to 0 or 1? I think booleans are implemented that way...


HTH,

Frederik Soete

Op do 27 okt. 2022 11:42 schreef Steven Burrows <steven.burrows@...>:

Trying to call a DLL function where the documentation says one of the params is type “BOOL”

Cant see that as an Argument Type in XPA, and try as I might nothing else seems to work. Either Magic gives an error, it crashes, or the DLL fails to work as expected.

(The DLL functions that have recognisable Argument Types are working)

 

Steven Burrows

 


Steven Burrows
 

FYI, eventually after changing things (but not the dll - honest) a type “2” does the job. BOOL identifies 0/non-0 which is good enough.

 

Steven Burrows

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Frederik Soete via groups.io
Sent: 27 October 2022 10:53
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] CallDLL with a BOOL Param

 

Hi Steven,

 

Wild ass guess, have you tried pretending it's an integer equal to 0 or 1? I think booleans are implemented that way...

 

 

HTH,

 

Frederik Soete

 

Op do 27 okt. 2022 11:42 schreef Steven Burrows <steven.burrows@...>:

Trying to call a DLL function where the documentation says one of the params is type “BOOL”

Cant see that as an Argument Type in XPA, and try as I might nothing else seems to work. Either Magic gives an error, it crashes, or the DLL fails to work as expected.

(The DLL functions that have recognisable Argument Types are working)

 

Steven Burrows