>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?
The standard BOOL return from C++ is a SHORT; if you wrap the result in an IIF(), you'll get what you want:
lMyResult = IIF(MyDLLFunctionCall() = 0, .F., .T.)