PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Art Araya on April 27, 2005, 04:39:41 PM

Title: ActiveX DLL - Boolean property problem
Post by: Art Araya on April 27, 2005, 04:39:41 PM
ActiveX DLL Firefly Newbie here...

I was able to incorporate an ActiveX DLL into my FireFly project by using the ActiveX/COM control on the toolbox, setting the ProgID, and then using the the FireFly created DispatchID to access the DLLs properties and methods.  So far so good.  I have one problem however which I can't figure out.

One of the properties of the ActiveX DLL returns a VB Boolean value.  This works properly when run from VB - returning True and False correctly.  But in FireFly this property always returns 65535.  Any ideas what's up and  how I can correct this?

TIA
Title: ActiveX DLL - Boolean property problem
Post by: Jose Roca on April 27, 2005, 05:58:58 PM
The PowerBASIC compilers insist in convert a %VT_BOOL variant into a long value, but in COM %VT_BOOL is an integer, so use CINT to convert the value and you will get 0 and -1, e.g. CINT(VARIANT#(varValue)), or just assume that if it is not False (0) it's True (non zero).
Title: ActiveX DLL - Boolean property problem
Post by: Art Araya on April 27, 2005, 06:10:36 PM
Thanks Jose.  The problem is that the return value is always the same (65535).  When converted to an INT it is always -1.  When I test it using different values that should cause this property to return 0, it never does.

Again, this same property when run from a VB6 app works properly.
Title: ActiveX DLL - Boolean property problem
Post by: Art Araya on April 27, 2005, 06:15:21 PM
Scratch what I just said.  I just retested this ActiveX DLL from within a VB6 test application and the property is failing there also.  This is not a FF issue.  Sorry for the false alarm guys.
Title: ActiveX DLL - Boolean property problem
Post by: Jose Roca on April 27, 2005, 06:24:49 PM
Tell us the name of the OCX, just in case somebody knows it; post the relevent code you're using to call this property; set the variant to EMPTY before the call; check the value of OBJRESULT after the call to see if it returns an error.

P.S. You have posted while I was compossing my reply. In any case, if you have more questions fon't forget to post relevant information.