[MPlayer-dev-eng] Windows COM question

Georgi Petrov gogothebee at gmail.com
Wed Feb 16 12:50:43 CET 2011


Well, one more COM related question.

Please excuse my misunderstanding, but MPlayer is the first
non-Microsoft project, which I have to connect to the "Microsoft
world" of COM.

Please correct me if I got it all wrong:

Sincle MPlayer isn't statically linked with any DLL I'm interested in
and is coded in C, I have to do the following if I want to use any COM
interface:

1. Use LoadLibrary to get a pointer to ole32.dll
2. Use GetProcAddress to get a pointer to CoInitializeEx inside ole32.dll.
3. Call CoInitializeEx to init the COM library.
4. Use GetProcAddress to get a pointer to CoCreateInstance inside ole32.dll.
5. Call CoCreateInstance with the EVR CLSID.
6. Use the pointer from the previous call to handle EVR afterwards.
7. When I'm finished, use GetProcAddress to get a pointer to Release
function inside ole32.dll and free the resources.

Either I'm missing something or this is the way I'm supposed to
proceed. All my current experiments from MSVC with C++ examples were
much, Much, MUCH easier and intuitive. I'm literally wasting weeks for
so simple things, so some help will be great!

I'm also not entirely sure how should I use the interfaces from plain
C. I'm sorry I'm wasting your time with my struggles, but I'm lost.
After my failure to succeed with Media Foundation (don't even ask), I
have to access EVR as a DS filter and I'm frustrated by the
difficulties I'm against.


More information about the MPlayer-dev-eng mailing list