Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Roger Stoltz wrote:
David, I don't get exactly what you're trying to do.
It seems like you're trying to create COM server and register something else that you have developed (CMyEventHandler?) for receiving COM events. Right?


My overall intent is to open a .mp3 file using the Windows Media Player COM object, and then read some information from one of the headers. I can't get this information until the player has loaded the .mp3 file. A side effect of loading the .mp3 file is that it will start playing it. To get around this, I need to respond to the 'play' event and stop it. That's what got me to looking at the IWMPEvents interface.

Roger Stoltz wrote:
What I'm trying to figure out is why you're trying to create an instance of your CMyEventhandler...
Is it really a COM server? If so, from where is it created and does the header files created have a CLSID for it?

Usually you would create a COM server with e.g. ::CoCreateInstance(), or one of its equivalents. You provide the CLSID for the server, the IID for the desired interface and a pointer to store the interface pointer in if the call was successful.
If the server produces COM events that the client is interested in, the client uses a mechanism in the server to register itself as an event listener (Advise()?).
From your explanation I don't see the above happening, a part from calling CreateInstance but for what looks to me as the "wrong" object.
Can you elaborate on this a bit further David?


Good questions. As I've done very little with COM, some of the terms and procedures are still a mystery. Other pieces of my code look like:
CComPtr<IWMPPlayer4> player;
HRESULT hr = player.CoCreateInstance(__uuidof(WindowsMediaPlayer), 0, CLSCTX_INPROC_SERVER); 

CComPtr<IConnectionPoint> connectionPoint;
CComPtr<IConnectionPointContainer> connectionContainer;
player->QueryInterface(&connectionContainer);
connectionContainer->FindConnectionPoint(__uuidof(IWMPEvents), &connectionPoint);

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Man who follows car will be exhausted." - Confucius


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 
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 

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.