• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

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
0
tmolnar
Asked:
tmolnar
  • 3
  • 2
  • 2
1 Solution
 
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
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
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
 
tmolnarAuthor Commented:
Thanx, abancroft...
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now