Click here to Skip to main content
15,921,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to check memory how many? Pin
Patrick Tang11-Mar-10 16:05
Patrick Tang11-Mar-10 16:05 
GeneralRe: How to check memory how many? Pin
chevu11-Mar-10 17:23
chevu11-Mar-10 17:23 
GeneralRe: How to check memory how many? Pin
Patrick Tang11-Mar-10 20:39
Patrick Tang11-Mar-10 20:39 
GeneralRe: How to check memory how many? Pin
Richard MacCutchan11-Mar-10 21:52
mveRichard MacCutchan11-Mar-10 21:52 
Questionconfused MFC CREATING CLASS AND MESSASE HANDLE Pin
acce5511-Mar-10 14:56
acce5511-Mar-10 14:56 
AnswerRe: confused MFC CREATING CLASS AND MESSASE HANDLE Pin
chevu11-Mar-10 17:27
chevu11-Mar-10 17:27 
AnswerRe: confused MFC CREATING CLASS AND MESSASE HANDLE Pin
David Crow12-Mar-10 3:05
David Crow12-Mar-10 3:05 
Questionbuild error while compiling log4cpp using visual studio .net 2003 Pin
deardyg11-Mar-10 12:33
deardyg11-Mar-10 12:33 
AnswerRe: build error while compiling log4cpp using visual studio .net 2003 Pin
Stuart Dootson11-Mar-10 16:26
professionalStuart Dootson11-Mar-10 16:26 
QuestionHello how should i use the this pointer if it is a function param as void *this Pin
nah133711-Mar-10 11:16
nah133711-Mar-10 11:16 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Jonathan Davies11-Mar-10 12:21
Jonathan Davies11-Mar-10 12:21 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
zhq0000111-Mar-10 14:25
zhq0000111-Mar-10 14:25 
GeneralRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Jonathan Davies12-Mar-10 0:01
Jonathan Davies12-Mar-10 0:01 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Stephen Hewitt11-Mar-10 14:41
Stephen Hewitt11-Mar-10 14:41 
GeneralRe: Hello how should i use the this pointer if it is a function param as void *this Pin
nah133711-Mar-10 19:11
nah133711-Mar-10 19:11 
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 

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.