CPB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using Pascal units with IUnknown
> I am trying to use some Pascal code in a BCB project. In that Pascal
> code is an interface descended from IUnknown. When the .hpp files
> were generated, IUnknown was generated as Ole2::IUnknown. When I try
> to compile this, I get the error 'IUnknown' is not a member of
> 'Ole2'.
>
> Is what I am trying to do possible, or would I need to make a
> special version of that code for BCB, declared using
> TInterfacedObject or something like that?
Your Pascal source is probably including the unit Ole2. If you are
trying to get this to work under BCB3, you'll have to change it to
use the unit ActiveX. To make in cross compilable, use something
like this in your Pascal source:
uses
Windows, Dialogs, etc...,
{$IFDEF VER110}
ActiveX,
{$ELSE}{$IFDEF VER93}
Ole2,
{$ELSE}
!! { ERROR! Only available for Win32! }
{$ENDIF}
...;
Note that VER110 identifies the Pascal compiler in BCB3 and VER93
identifies the Pascal compiler in BCB1.
Michael Trier
Developer's Corner Journal
http://www.pobox.com/~dcj/journal
mailto:mtrier@pobox.com
-----------------------------
Actual News Headlines:
War Dims Hope for Peace
W Komornicki's Home Page |
Main Index |
Thread Index