In general and to be completely safe I would agree (generally a bad
practice, but who wants to use C++ if it can be avoided).

However if objects are created in the same apartment and same thread with an
Inprocess DLL only, I have always found them to be in the same
process/thread space. Actually from the way I see this, this must always be
okay - as long as the COM objects reside in the same DLL and same apartment,
as the is nothing special in Delphi terms about the
TAutoObjectFactory.CreateComObject call.

For out of process or local servers this would always fail.

Comments Richard?

Myles.



> -----Original Message-----
> From: Richard Vowles [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 16, 2000 12:23 PM
> To:   Multiple recipients of list delphi
> Subject:      Re: [DUG]:  COM types and pointers
> 
> You are looking for big trouble. If the two objects are just "com" objects
> (really "ole" objects as Delphi does not support COM, only C++ supports
> COM,
> you need an IDL compiler to support COM), you are restricted to the data
> types valid for a variant. There is around 15 of these, and a record
> pointer
> ain't one of them (as it doesn't need to be in the same process space - it
> could be running inside MTS for example, so pointers are bad news for
> OLE).
> 
> ----- Original Message -----
> From: "Neil Anderson" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Friday, June 16, 2000 11:39 AM
> Subject: [DUG]: COM types and pointers
> 
> 
> > Hello again
> >
> > Perhaps a stupid question but here goes ...
> >
> > I have a COM object which will be called by ASP etc and so requires dual
> > interfaces, valid types etc. This object calls an (internal - will never
> be
> > called by anything except my object) object, I would like to pass a
> record
> > pointer between the two.
> > I have butchered the generated typelib.pas files to change the datatype
> to
> > pointer and it appears to work. I cannot seem to get the typelib editor
> to
> > accept the pointer type even with dual and automation type flags
> unchecked
> > for the interface.
> > Is there a way to accomplish this or I am looking for BIG trouble ?
> 
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to