Events between COM object.

It's possible to send events between
COM objects?
Something like PostMessage()...
If its possible, send a small example,
please.
Thnx  
                Tibi
tmolnarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

abancroftCommented:
You can use PostMessage() if both COM objects implement window procedures.

If not, you need to implement the IConnectionPoint interface in both objects.
0
BridgeCommented:
Use connection points. CConnectionPoint. This is what Active X controls use to fire events and you can use them in any COM objects.
0
abancroftCommented:
Isn't that what I suggested? (CConnectionPoint is an implementation of IConnectionPoint).
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

BridgeCommented:
Sorry abancroft. only read the first half of your answer. Oooops.
0
tmolnarAuthor Commented:
I know about ConnectionPoints, but
in that case event fireing is calling some interface functions, and it is syncronus mode (the caller must wait until the function return).
  Without using windows mwssage queues,
it is possible to send events in asyncronus mode?
0
abancroftCommented:
I can think of 2 ways:

1. If both COM objects expose windows, you can use PostMessage().
2. Have a seperate "event" thread that is responsible for calling the interface functions - then only the "event" thread will be blocked.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tmolnarAuthor Commented:
Thanx, abancroft...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.