Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VC COM object Returning a Logical Result
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00106809
Message ID:
00106822
Views:
28
>The following is a message from a co-worker, does anyone know?
>
>-------
>
>I'm writing a simple COM object in VC++ 5.0 that will be used in VFP 5.0. The control has a single interface that has four basic functions. One returns a string, one returns an int, on returns a float, and one returns a BOOL. In VB, all four functions seem to work fine. In VFP, all work fine except the method that returns a BOOL. VFP gets a 0 or a 1 from it, not a .t. or .f. (it gets an integer, not a logical).
>
>In the COM IDL file, I define the function as:
>[id(6), helpstring("...")] HRESULT GetBoolInfo([in]BSTR bstrRequest, [out, retval]BOOL *pbInfo);
>
>Does anyone have any idea what I need to do to get VFP to recognize the [retval] parameter as a VFP logical variable? Is this even posible?

Gary,

I don't know if this will help, but consider the following: Boolean return values in the Windows API are generally acutally numeric. Zero is equivalent to logical false, and not zero (usually one) logical true. You can see this by declaring any API call that returns a BOOL as an INTEGER or SHORT, and checking the value.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform