Click here to Skip to main content
15,889,346 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionATL compiler error Pin
David Crow11-Mar-10 11:00
David Crow11-Mar-10 11:00 
AnswerRe: ATL compiler error Pin
LunaticFringe11-Mar-10 12:36
LunaticFringe11-Mar-10 12:36 
GeneralRe: ATL compiler error Pin
David Crow12-Mar-10 2:56
David Crow12-Mar-10 2:56 
GeneralRe: ATL compiler error Pin
Roger Stoltz12-Mar-10 3:53
Roger Stoltz12-Mar-10 3:53 
GeneralRe: ATL compiler error Pin
David Crow12-Mar-10 4:13
David Crow12-Mar-10 4:13 
GeneralRe: ATL compiler error Pin
Roger Stoltz12-Mar-10 5:08
Roger Stoltz12-Mar-10 5:08 
GeneralRe: ATL compiler error Pin
David Crow12-Mar-10 5:14
David Crow12-Mar-10 5:14 
GeneralRe: ATL compiler error Pin
Roger Stoltz12-Mar-10 5:43
Roger Stoltz12-Mar-10 5:43 
DavidCrow wrote:
It's just getting notified of events that's troubling me.


Okay...

Basically this is what you have to do:

  1. Implement a class that derives from the event interface you're interested in and put the interface in the COM_MAP. As I understand it you've already done this part.
  2. When you've successfully created the Media Player server and got an interface pointer (IWMPPlayer), you create an instance of the class mentioned above; not by using CreateInstance(), use new or similar (you know what I mean).
  3. Ask IWMPPlayer for the IConnectionPointContainer interface as described in the article.
  4. Find the connection point you want, IWMPEvents, by calling IConnectionPointContainer::FindConnectionPoint() and you should get an IConnectionPoint interface in return as described in the article.
  5. Register your class as an event listener by calling IConnectionPoint::Advise() and provide a pointer to your instance of your CMyEventHandler. Store the cookie and the IConnectionPoint interface pointer as you'll need it when you unregister from the server.
  6. You should be all set to catch events from Media Player!
  7. Remember to call IConnectionPoint::Unadvise() when you're done.


The ATLDuck sample[^] explains how to set up connection point further. It gives you a complete working example and not just some code snippets.

"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionRe: ATL compiler error Pin
David Crow12-Mar-10 5:55
David Crow12-Mar-10 5:55 
AnswerRe: ATL compiler error Pin
Roger Stoltz12-Mar-10 8:34
Roger Stoltz12-Mar-10 8:34 
GeneralRe: ATL compiler error Pin
David Crow12-Mar-10 9:50
David Crow12-Mar-10 9:50 
GeneralRe: ATL compiler error Pin
Roger Stoltz16-Mar-10 0:34
Roger Stoltz16-Mar-10 0:34 
GeneralRe: ATL compiler error Pin
David Crow16-Mar-10 2:58
David Crow16-Mar-10 2:58 
GeneralRe: ATL compiler error Pin
Roger Stoltz16-Mar-10 4:44
Roger Stoltz16-Mar-10 4:44 
GeneralRe: ATL compiler error Pin
David Crow16-Mar-10 9:00
David Crow16-Mar-10 9:00 
GeneralRe: ATL compiler error Pin
Roger Stoltz19-Mar-10 2:30
Roger Stoltz19-Mar-10 2:30 
QuestionSystem Tray Context Menu Pin
MrMcIntyre11-Mar-10 9:09
MrMcIntyre11-Mar-10 9:09 
AnswerRe: System Tray Context Menu Pin
loyal ginger11-Mar-10 9:31
loyal ginger11-Mar-10 9:31 
GeneralRe: System Tray Context Menu Pin
MrMcIntyre11-Mar-10 9:40
MrMcIntyre11-Mar-10 9:40 
GeneralRe: System Tray Context Menu Pin
loyal ginger11-Mar-10 9:59
loyal ginger11-Mar-10 9:59 
GeneralRe: System Tray Context Menu Pin
loyal ginger11-Mar-10 10:07
loyal ginger11-Mar-10 10:07 
GeneralRe: System Tray Context Menu Pin
LouisLewis15-Mar-10 11:05
LouisLewis15-Mar-10 11:05 
AnswerRe: System Tray Context Menu Pin
David Crow11-Mar-10 10:45
David Crow11-Mar-10 10:45 
AnswerRe: System Tray Context Menu Pin
Richard MacCutchan11-Mar-10 10:51
mveRichard MacCutchan11-Mar-10 10:51 
QuestionEncoding a string Pin
Herboren11-Mar-10 8:42
Herboren11-Mar-10 8:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.