BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pointer type in type library editor

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Aug 21, 2003 4:47 pm    Post subject: Pointer type in type library editor Reply with quote



Hi, all,

How can I declare a parameter or function return type to be a Pointer type
in a type library editor? There is no Pointer type available to select in
both Pascal and IDL.

But I know the Pointer type has been using in ActiveX.pas as follow:

function CoInitialize(pvReserved: Pointer): HResult; stdcall;

and in OLE Automation (Version 2.0), file name "stdole2.tlb" as follow:

IPicture = interface(IUnknown)
...
function SaveAsFile(var pstm: Pointer; fSaveMemCopy: WordBool; out
pcbSize: Integer): hResult; stdcall;
...
end;


Appreciated for any help,
Chiumen



Back to top
Maynard Philbrook
Guest





PostPosted: Thu Aug 21, 2003 5:02 pm    Post subject: Re: Pointer type in type library editor Reply with quote



i am not sure if this is what you want but the
VAR operator in the parameters signifies that the value be passed via
reference which means the compiler passes a pointer address to the object
from the caller.
this means that you can modify the callers info.
an object with out the VAR simply gets a copy of its contents placed on the
stack and this does not effect the original unless the object is already of
type
pointer that points to a known type., types like this could be a Pchar, or
memory
pointer directly.., since these items are 4 byte pointers to start with they
are simply
pushed onto the stack as a Dword with the pointers value..






Chiumen wrote:

Quote:
Hi, all,

How can I declare a parameter or function return type to be a Pointer type
in a type library editor? There is no Pointer type available to select in
both Pascal and IDL.

But I know the Pointer type has been using in ActiveX.pas as follow:

function CoInitialize(pvReserved: Pointer): HResult; stdcall;

and in OLE Automation (Version 2.0), file name "stdole2.tlb" as follow:

IPicture = interface(IUnknown)
...
function SaveAsFile(var pstm: Pointer; fSaveMemCopy: WordBool; out
pcbSize: Integer): hResult; stdcall;
...
end;

Appreciated for any help,
Chiumen

--
To See what real programmers do in their spare time visit
http://jamie12.home.mindspring.com
home of PC bit software ..
Please send comments about my work .



Back to top
Guest






PostPosted: Thu Aug 21, 2003 10:36 pm    Post subject: Re: Pointer type in type library editor Reply with quote



Thanks for the reply, Michael,

I just try to use the untyped Pointer or any user-defined types in the type
library editor, something like:

procedure Method1(Param1: Pointer); safecall;

Chiumen

"Michael Kelly" <mkelly2002 (AT) adelphia (DOT) net> wrote

Quote:
On Thu, 21 Aug 2003 09:47:07 -0700, <Chiumen> wrote:

Hi, all,

How can I declare a parameter or function return type to be a Pointer
type
in a type library editor? There is no Pointer type available to select
in
both Pascal and IDL.

What exactly are you trying to do?
The reason there isn't a plain pointer type for
use in the type library editor is because then
there would be no type information. COM
has to deal with data types across process
and/or machine boundaries(see Marshalling)
so if it doesn't know the type, it doesn't know
how to deal with it.

If you want to pass buffers of raw data you may
be able to use a BSTR since it doesn't determine
length by encountering a NULL char.

The best site I've found to get started in Delphi COM
is www.techvanguards.com

Also you might try
www.delphi3000.com
www.mers.com

or let us know more and maybe someone here can
contribute suggestions.

--

"I don't want to belong to any club that would have me as a member."

-- Groucho Marx



Back to top
Michael Kelly
Guest





PostPosted: Fri Aug 22, 2003 11:22 pm    Post subject: Re: Pointer type in type library editor Reply with quote

On Thu, 21 Aug 2003 15:36:49 -0700, <Chiumen> wrote:

Quote:
Thanks for the reply, Michael,

I just try to use the untyped Pointer or any user-defined types in the type
library editor, something like:

procedure Method1(Param1: Pointer); safecall;

Hi. I got that the first time. The point is, in COM
nothing is usually that straight forward as it is
in regular programming. To avoid lots of
headaches it's probably best to get 3 or
4 books on COM programming and really
read them through. The terminology is
much too confusing to explain much in
a couple of paragraphs on a ng.

Don Box is very good if you understand C++.
There are a few books around with some
Delphi COM stuff but most of them are
for C++.

--

"I don't want to belong to any club that would have me as a member."

-- Groucho Marx

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.