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.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to