Board index » cppbuilder » OCX data type conversion problem

OCX data type conversion problem

I have a project built with v1 that works fine using an OCX from Eastman
Software. Converted to v4 and now have data type problem. In v1 the String
data type was converted to an AnsiString. In v4 the String data type is
converted to BSTR. The BSTR appears to be defined as a WideChar string. This
type is incompatible with the LPCSTR expected by the control. What's up?

I'm thinking of changing the _OCX.h file from BSTR to AnsiString.

Thanks,
Mike Swiinarski

 

Re:OCX data type conversion problem


Quote
> converted to BSTR. The BSTR appears to be defined as a WideChar string.
This
> type is incompatible with the LPCSTR expected by the control. What's up?

> I'm thinking of changing the _OCX.h file from BSTR to AnsiString.

Im confused, what do you mean by "LPCSTR expected by the control"?

--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Re:OCX data type conversion problem


The control expects a LPCSTR, which is a 'C' style string. single byte with
a zero terminator. The control does not expect a BSTR. When BCB generated
the _OCX.h file it decided to use BSTR as the parameter type.

Mike

Quote
Binh Ly wrote in message <81007c$n...@forums.borland.com>...
>> converted to BSTR. The BSTR appears to be defined as a WideChar string.
>This
>> type is incompatible with the LPCSTR expected by the control. What's up?

>> I'm thinking of changing the _OCX.h file from BSTR to AnsiString.

>Im confused, what do you mean by "LPCSTR expected by the control"?

>--
>Binh Ly
>Visit my COM Notes at http://www.castle.net/~bly/com

Other Threads