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 

What Delphi object should i start with to "implemnt" a dispi

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





PostPosted: Thu Aug 11, 2005 7:50 pm    Post subject: What Delphi object should i start with to "implemnt" a dispi Reply with quote



i know i cannot directly implement a dispinterface.
i know that the DispID's are used in a call to IDispatch.Invoke.

i need to connect an object that implements IDispatch to a Microsoft COM
Object (e.g. Outlook application).

i know that i'm going to have to create an object that implements IDispatch,
and use ConnectEvents to connect it to the specific Outlook object i'm
using.

My question is, which if the dozen COM/OLE objects should i be using? Is
there one that can be given the dispinterface i want, and can route the
Invoke's into individual method calls?

Or do i have to implement Invoke myself, and have one huge case statement
that has all the DispID's hard coded?


Back to top
John Carlyle-Clarke
Guest





PostPosted: Fri Aug 12, 2005 9:21 am    Post subject: Re: What Delphi object should i start with to "implemnt" a d Reply with quote



"Ian Boyd" <ian.borlandnews010 (AT) avatopia (DOT) com> wrote in
news:42fbac07 (AT) newsgroups (DOT) borland.com:

Quote:
i know i cannot directly implement a dispinterface.
i know that the DispID's are used in a call to IDispatch.Invoke.

Well, you can.. perhaps it depends what you mean by "directly". If
you mean that Delphi objects don't have automatic support for it, then
that's true.

I assume you are trying to receive events from an automation server?

This is not too hard. I wrote my own code to do it, based on code in
the OleServer.pas VCL source, and it was actually simpler than I
thought it would be.

And yes, ultimately somewhere there has to be a big case statement :)


Quote:
i need to connect an object that implements IDispatch to a
Microsoft COM Object (e.g. Outlook application).

My question is, which if the dozen COM/OLE objects should i be
using?

My object is declared as..

type TCOMServerEventDispatch = class(TObject, IUnknown, IDispatch)

...so everything is hand-rolled. There are Delphi classes which will
support Dispatch interfaces, but they are not really suited for event
sinking.

I would happily share my code with you, but I would suggest you take a
look at the excellent ..

http://www.techvanguards.com/products/eventsinkimp/

... to see if it will do what you want.


Back to top
Ian Boyd
Guest





PostPosted: Fri Aug 12, 2005 11:20 am    Post subject: Re: What Delphi object should i start with to "implemnt" a d Reply with quote



Quote:
http://www.techvanguards.com/products/eventsinkimp/

i've been there many times in the past. i forgot they talked about event
sinks.

i've hooked up events before, but the events interface was a real interface,
not a dispinterface; so it was much easier to implment. i just
wished/thought/assumed that Delphi has some language or shortcut for
implementing a dispinterface.

Thanks for the clarifications.



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.