Board index » cppbuilder » Creating Client which Implements IMyEvents interface

Creating Client which Implements IMyEvents interface

Hi all,

I've created a simple in-process COM Object, and it supports 2 events,
OkPressed and CancelPressed.  From my server, I can call Fire_OkPressed, but
how can I make my client receive the notification?

Here's what I've tried:  Created a new COM Object in my client application.
From the wizard, pressed the "List" button next to the implemented
interface, and selected the appropriate IMyEvents interface.  The wizard
won't let me implement IMyEvents, saying, "The selected interface is not
either Dual or Custom."  Well, its a dispinterface, but I didn't have any
say in that decision.

I cannot seem to find any documentation/information on implementing a client
event listener in Builder anywhere.

What am I missing, or how else can I do it?

Thanks in advance,
JR

 

Re:Creating Client which Implements IMyEvents interface


After many annoyances [including a few Builder BUGS], I have this working:

I have an in-proc COM server which calls client events trapped by a fairly
simple Builder application.  The server utilizes a Builder designed form to
get user input and passes the info along to my client's EventOk.
This shouldn't be so difficult, but in reality it is.  IMHO, there are some
real problems with the COM wizard and type-library editor which are supposed
to make our lives so much easier.  What's the point in all this stuff if it
doesn't work without days of study figuring out how to make it do as it's
supposed to?

1)  Why can you not use the wizard to implement an extant dispinterface?  If
you've checked the "Generate Events" check box and created your server, it
just seems natural that the wizard could handle your event interface and
implement stubs in your client application!
2)  Why is it that the initial interface generated for any COM object cannot
be effectively derived from anything besides IUnknown?  Would it be so hard
to add a ListBox there, so I could derive from IDispatch?
3)  Actually, I kind of understand this one, but it's still annoying and
warrants an error message.  If you change the parent interface of an
existing interface from IUnknown to, say, IDispatch, afterwards, you'll get
linker errors on the IDispatch methods [GetNamesOfIds(), etc.].  This at
least warrants a warning message, "You're better off creating a new
interface and deleting the old one than doing this..."
4)  Why is there no indication that an interface cannot be implemented in a
class due to duplicate method names?  This cost me two bleeping days to
figure out!  Most people never would.
5)  WHEN IS BORLAND GOING TO FIX THIS E2015 BUG IN THEIR COMPILER!?!?!?  I'm
so sick of the "ambiguity" anomaly, and there's no help for it.  We're just
expected to shift stuff around until we can "make the problem go away", and
there's no damned excuse for it.  If the problem is the compiler [as I
suspect], then why won't they fix it?  If it's a bug in the code, why do
their code generators create code that doesn't compile?  If any of you want
to tell me to prove it, by God I can give you an example and show you the
error of their 2-pass ways!  I'll do so when somebody promises to MAKE AN
ATTEMPT to address the issue.
6)  When is support for Delphi going to be discontinued?  I'd sooner write
VB code than deal with Borland's pet Object Pascal {*word*99}.  Now they've got a
whole slew of people out there who don't understand anything but a DEAD
LANGUAGE [Pascal, along with their pet extensions].  Let's say you were
going to select a World-Wide-Language.  Would you choose Latin?  At first
glance, it might seem like a good idea...  But when you delve deeper, you
should quickly discern that this would be a TERRIBLE CHOICE.  Delphi and the
Object Pascal initiative was a mistake; yet it doesn't appear that Builder
will get the attention from Borland's resources that it should as a result.

Is there anybody out there?  HELLO, BUELLER?  Seems like, if I can't already
find the answers to my questions on Deja [or Google...] that I never gat an
answer in these forums.  Well, I guess my research at least is pretty good.
Sorry to sound peevish, but the reason I'm using Builder and forcing others
to do the same is that it's supposed to make this kind of stuff easy.  Well,
in a lot of cases it does, but, damnit, Borland needs to get their code and
documentation fixed.  With VC6, I'd have been done with this project 3 days
ago.

JR

P. S.  Please feel free to spam me; my delete key is always handy.  Of
course, if you have criticism fair and just, I will read it and respond
civilly.

"J. R. Antley" <jant...@phoenixdsl.com> wrote in message
news:96n207$5rc2@bornews.inprise.com...

Quote
> Hi all,

> I've created a simple in-process COM Object, and it supports 2 events,
> OkPressed and CancelPressed.  From my server, I can call Fire_OkPressed,
but
> how can I make my client receive the notification?

> Here's what I've tried:  Created a new COM Object in my client
application.
> From the wizard, pressed the "List" button next to the implemented
> interface, and selected the appropriate IMyEvents interface.  The wizard
> won't let me implement IMyEvents, saying, "The selected interface is not
> either Dual or Custom."  Well, its a dispinterface, but I didn't have any
> say in that decision.

> I cannot seem to find any documentation/information on implementing a
client
> event listener in Builder anywhere.

> What am I missing, or how else can I do it?

> Thanks in advance,
> JR

Other Threads