Board index » delphi » What does this piece of code say??

What does this piece of code say??

When create a asp object with Delphi, in the project code, there usually be
piece of code like
exports
  DllGetClassObject,
  DllCanUnloadNow,
  DllRegisterServer,
  DllUnregisterServer;

{$R *.TLB}

{$R *.RES}

What is the use of these code??

Can someone explain it for me??

Many thanks in advance..

Ron.

 

Re:What does this piece of code say??


"Ron TJ HUANG" <ron_hu...@psitech.com.tw> wrote in message
news:9pu7ur$7ch$1@news.seed.net.tw...

Quote
> When create a asp object with Delphi, in the project code, there usually
be
> piece of code like
> exports
>   DllGetClassObject,
>   DllCanUnloadNow,
>   DllRegisterServer,
>   DllUnregisterServer;

the exports keyword defines the routines that follow it as being available
to any units that wish to use the code.

--
Murphy's Military Laws:  32. One enemy soldier is never enough, but two is
entirely too many.

ICQ: 91418899
http://www.planeted.co.uk
http://www.eduffe.freeserve.co.uk

Re:What does this piece of code say??


what  during the execution of the asp object, what mechanism or program
would use the exported methods?

Ron.

"Windoze 98 Ed" <eddu...@btinternet.com> ???g??l
news:9purgr$mqu$1@uranium.btinternet.com...

Quote

> "Ron TJ HUANG" <ron_hu...@psitech.com.tw> wrote in message
> news:9pu7ur$7ch$1@news.seed.net.tw...
> > When create a asp object with Delphi, in the project code, there usually
> be
> > piece of code like
> > exports
> >   DllGetClassObject,
> >   DllCanUnloadNow,
> >   DllRegisterServer,
> >   DllUnregisterServer;

> the exports keyword defines the routines that follow it as being available
> to any units that wish to use the code.

> --
> Murphy's Military Laws:  32. One enemy soldier is never enough, but two is
> entirely too many.

> ICQ: 91418899
> http://www.planeted.co.uk
> http://www.eduffe.freeserve.co.uk

Re:What does this piece of code say??


In article <9pv726$5j...@news.seed.net.tw>, Ron TJ HUANG
<ron_hu...@psitech.com.tw> writes

Quote
>what  during the execution of the asp object, what mechanism or program
>would use the exported methods?

COM uses them. The last two are used to register and un-register the
classes in the DLL. A utility like REGSVR32 (or whatever it is) when
used, will 'LoadLibrary' the DLL/OCX, then use GetProcAddress to find
DllregisterServer and then call it. No magic there. There are examples
to do this included with Delphi.
--
Charles Bainbridge

Re:What does this piece of code say??


Many thanks for the response.

But how are my methods in an ASP object called??
They are not exported.

Many thanks.

Ron.

"Charles Bainbridge" <char...@zambesi.demon.co.uk> ?????
news:hxtR4kAdG0w7EwS2@zambesi.demon.co.uk...

Quote
> In article <9pv726$5j...@news.seed.net.tw>, Ron TJ HUANG
> <ron_hu...@psitech.com.tw> writes
> >what  during the execution of the asp object, what mechanism or program
> >would use the exported methods?

> COM uses them. The last two are used to register and un-register the
> classes in the DLL. A utility like REGSVR32 (or whatever it is) when
> used, will 'LoadLibrary' the DLL/OCX, then use GetProcAddress to find
> DllregisterServer and then call it. No magic there. There are examples
> to do this included with Delphi.
> --
> Charles Bainbridge

Re:What does this piece of code say??


A COM object contains a resource that holds the type library. This type
libary contains a interface for the object.
A COM object needs to be registered (e.g. with regsvr32) for the system to
know the interface and the location of the object.

For more information on using COM in Delphi see www.techvanguards.com.

"Ron TJ HUANG" <ron_hu...@psitech.com.tw> wrote in message
news:9q3qc7$t0i$1@news.seed.net.tw...

Quote
> Many thanks for the response.

> But how are my methods in an ASP object called??
> They are not exported.

> Many thanks.

> Ron.

> "Charles Bainbridge" <char...@zambesi.demon.co.uk> ?????
> news:hxtR4kAdG0w7EwS2@zambesi.demon.co.uk...
> > In article <9pv726$5j...@news.seed.net.tw>, Ron TJ HUANG
> > <ron_hu...@psitech.com.tw> writes
> > >what  during the execution of the asp object, what mechanism or program
> > >would use the exported methods?

> > COM uses them. The last two are used to register and un-register the
> > classes in the DLL. A utility like REGSVR32 (or whatever it is) when
> > used, will 'LoadLibrary' the DLL/OCX, then use GetProcAddress to find
> > DllregisterServer and then call it. No magic there. There are examples
> > to do this included with Delphi.
> > --
> > Charles Bainbridge

Other Threads