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 

Retreive and Set property of a COM Object.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Patrick Paquette
Guest





PostPosted: Thu Jul 13, 2006 10:40 pm    Post subject: Retreive and Set property of a COM Object. Reply with quote



Hi guru !

I'm searching for a way to set a property at runtime of an COM Object.

a bit like i can do with a TObject descendant using the RTTI

if IsPublishedProp(Button1, 'Caption') then
SetStrProp(Button1, 'Caption', 'test');

COM := CreateOleObject('XfoComCtl.XfoObj')
COM is an interface OleVariant

I know that is posible to retreive property cause the TLB importer and some
application like COM Inspector do it.
I want to be able to set the property by it name.

Also, i dont want to import the TLB. i want to be independant of any version
change of the COM object.

thanks
Patrick
Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Thu Jul 13, 2006 11:34 pm    Post subject: Re: Retreive and Set property of a COM Object. Reply with quote



On Thu, 13 Jul 2006 13:40:51 -0400, Patrick Paquette wrote:

Quote:
Also, i dont want to import the TLB. i want to be independant of any version
change of the COM object.

If your library supports a dual com interface then you can use the
methods of the IDispatch interface to retrieve type information.

You can enable type information (RTTI) for interfaces by using the
{$M+} directive but I don't know if this will help in your case.
There are several articles on Hallvard's blog that might help:
http://hallvards.blogspot.com/

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Back to top
Patrick Paquette
Guest





PostPosted: Fri Jul 14, 2006 2:29 am    Post subject: Re: Retreive and Set property of a COM Object. Reply with quote



Thanks Marc

With the new keyword "dual interface" i found other articles and i got
exactely what i want

http://pchapuis.developpez.com/typelibreader/#L1.1

It's in french





"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:1b09jcjk0mfvf$.dlg (AT) dlg (DOT) marcrohloff.com...
Quote:
On Thu, 13 Jul 2006 13:40:51 -0400, Patrick Paquette wrote:

Also, i dont want to import the TLB. i want to be independant of any
version
change of the COM object.

If your library supports a dual com interface then you can use the
methods of the IDispatch interface to retrieve type information.

You can enable type information (RTTI) for interfaces by using the
{$M+} directive but I don't know if this will help in your case.
There are several articles on Hallvard's blog that might help:
http://hallvards.blogspot.com/

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Back to top
Pascal Chapuis
Guest





PostPosted: Mon Jul 17, 2006 8:11 am    Post subject: Re: Retreive and Set property of a COM Object. Reply with quote

Patrick,

Glad to heard this "quick & dirty experimental" project is useful.

Best regards,

Pascal
chapsandchips.com


"Patrick Paquette" <NoSpam (AT) 4me (DOT) com> a écrit dans le message de news:
44b6bb45$1 (AT) newsgroups (DOT) borland.com...
Quote:
Thanks Marc

With the new keyword "dual interface" i found other articles and i got
exactely what i want

http://pchapuis.developpez.com/typelibreader/#L1.1

It's in french





"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:1b09jcjk0mfvf$.dlg (AT) dlg (DOT) marcrohloff.com...
On Thu, 13 Jul 2006 13:40:51 -0400, Patrick Paquette wrote:

Also, i dont want to import the TLB. i want to be independant of any
version
change of the COM object.

If your library supports a dual com interface then you can use the
methods of the IDispatch interface to retrieve type information.

You can enable type information (RTTI) for interfaces by using the
{$M+} directive but I don't know if this will help in your case.
There are several articles on Hallvard's blog that might help:
http://hallvards.blogspot.com/

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation 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.