Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-04

Using FPC-implemented CORBA intefaces (local, without broker) in CPP

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anton Kavalenka

Dear FPC devlopers,
can somebody point me to the simplest implementation of .SO (in C++) which can call the method of CORBA interface passed to the DLL. Interface itself passed from FPC program.

I'm trying to write plugin in CPP (DLL, SO) which on intialisation gets the Interface pointer to the Application API from host process.

Doing so in FPC is easy and straightforward under all platform II tried (win32-i386, x86_64-linux).

*function* cnvImportEx(nFormatId:integer; *const* FileName:PChar;hSp:IUnknown):integer;
*var*
  i:integer;
  uc:IMyApplicationAPI; // *API interface*
  vv:variant;
*begin*
  Result:=CNV_FAIL;
  *if* Assigned(hSp) *then*
  *begin*
    uc:=hSp as MyApplicationAPI; *// implicit QueryInterface*
    vv:='Test';
    uc.SetPropValue(-1,'Name',@vv);
    vv:=false;
    uc.SetPropValue(-1,'Lock',@vv);
    vv:=1000;
    uc.SetPropValue(1,'Size',@vv);
    *for* i:=1 *to* 1000 *do*
    uc.SetData(1,i,1000*sin(0.11*i));
    Result:=CNV_OK;
  *end*;
*end*;

How to do the same Hell in C++?

With best regards.

Reply by email