Board index » delphi » COM Object

COM Object

Hello

Is there someone who can explain me how to create a COM object ?
I read the manual but I don't understand how to do it.  I work a lot with
Visual Basic 5 since 2 years and everything is there for doing this job.  We
use a control that we have made in VB 5 and I try to do the same thing in
Delphi.  I must to say, I'm a new user of Delphi and I think I'm going to
love it but I need some HELP !

Thank you :-)

 

Re:COM Object


You should be able to make life easier by Importing the COM control
you want to use into Delphi.

From the Component menu, select the 'Import ActiveX Control' name
that you want to import. A TLB file should be generated that will
contain all the function prototypes.

For example, imagine a simple COM control that you created called MyCOM
would then create a Delphi class of TMyCOM and generate a MyCOM_TLB.pas
header file.

If you then include the TLB.pas file in a project you can declare an
object of this type an create it using the Delphi gerarated interface.

procedure TForm1.Button1Click(Sender : TObject);
Var
  MyCom : TMyCom;
begin
  MyCom := TMyCom.CoTMyCom.Create;
  MyCom.DoSomething;

  etc etc......
end;

kjb.

In article <pMtp4.2401$H07.61...@news.globetrotter.net>,
  "Marc Robitaille" <marcm...@globetrotter.net> wrote:

Quote
> Hello

> Is there someone who can explain me how to create a COM object ?
> I read the manual but I don't understand how to do it.  I work a lot
with
> Visual Basic 5 since 2 years and everything is there for doing this
job.  We
> use a control that we have made in VB 5 and I try to do the same
thing in
> Delphi.  I must to say, I'm a new user of Delphi and I think I'm
going to
> love it but I need some HELP !

> Thank you :-)

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads