Recent

Author Topic: Error:Automation Object Aplication  (Read 18390 times)

acapa

  • New Member
  • *
  • Posts: 10
Re: Error:Automation Object Aplication
« Reply #15 on: October 18, 2012, 11:34:31 am »
I was just reading that thread now
I found importtl  at FPC bin directory jus where I should look for before asking.

acapa

  • New Member
  • *
  • Posts: 10
Re: Error:Automation Object Aplication
« Reply #16 on: October 25, 2012, 10:47:35 am »

I have  imported full picgoto tbl to my project and tried to run the application as com server but  any client tested  was able to connect.
I dont know what I´m doing wrong because inicialization  code works fine for delphi but seems to have no effect on FPC
PicgotoPlusfi.pas initialization section
Quote

initialization
CoInitializeex(nil, COINIT_APARTMENTTHREADED);
 //RegisterThySelf;
 TAutoObjectFactory.Create(ComServer,TpgtFocuser, Class_Focuser,
   ciSingleInstance, tmApartment);

end.         

Quote
program PicgotoPlus;

{$IFDEF FPC}
  {$MODE Delphi}
{$ENDIF}

uses
{$IFNDEF FPC}
{$ELSE}
  Interfaces,
{$ENDIF}
Forms,comserv,
PicGoto in 'PicGoto.pas' {Main},
serial in 'serial.pas',
ptool in 'ptool.pas',
setupfrm in 'setupfrm.pas' {SetupDialogForm},
PicgotoPlus_TLB in 'PicgotoPlus_TLB.pas',
PicgotoPlusfi in 'PicgotoPlusfi.pas'{Focuser: CoClass},
PicgotoPlusi in 'PicgotoPlusi.pas' {Telescope: CoClass},
telescope in 'telescope.pas',
PicgotoPLusWi in 'PicgotoPLusWi.pas' {Filter: CoClass},
align in 'align.pas',
picplus in 'picplus.pas';

{$R *.TLB}
{$R *.res}

begin
   Application.Initialize;
   Application.CreateForm(TMain, Main);
  Application.Run;
end.

It possible to do what i trying (build a exe  COM server /automation object)  in Lazarus or must I  built my application as Active X control ?

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Error:Automation Object Aplication
« Reply #17 on: October 26, 2012, 01:48:37 pm »
Quote
It possible to do what i trying (build a exe  COM server /automation object)  in Lazarus or must I  built my application as Active X control ?
FPC does not have support for creating out of process COM servers. Only in-process (dll) COM servers are supported.

I have never tried but I doubt you can use the LCL (Forms,etc.) in a COM server dll. There is no real support for creating a visual ActiveX object neither.

 

TinyPortal © 2005-2018