The simple solution is to do a cast and pass it as an Integer. Just leave
the typelib alone and pass an Integer parameter which is actually the
address of the record/structure.

I have done this before - works fine. Can even pass object references this
way - I find this better, because you can then do a runtime type check using
the IS operator.
I would suggest the callee do as type check just to make sure the passed
Integer is valid. This is easier todo with

eg  PassRecord( Integer( @MyRecord ))
or  PassObjectReference( Integer( @MyObject ));

procedure PassObjectReference( Value: Integer );
...
if (Value is TMyObject) then ....


> -----Original Message-----
> From: Neil Anderson [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 16, 2000 11:40 AM
> To:   Multiple recipients of list delphi
> 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 ?
> 
> Thanks for all the help so far.
> 
> Neil
> --------------------------------------------------------------------------
> -
>     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