Trying to get




; // e436ebb3-524f-11ce-9f53-0020af0ba770 Filter Graph
CLSID_FilterGraph GUID <0e436ebb3h, 524fh, 11ceh, <9fh, 53h, 0h, 20h, 0afh, 0bh, 0a7h, 70h>>
; HKEY_CLASSES_ROOT\Interface\{56A868A9-0AD4-11CE-B03A-0020AF0BA770}
IID_IGraphBuilder GUID <56A868A9h, 0AD4h, 11ceh, <0B0H, 3Ah, 0h, 20h, 0AFh, 0BFh, 0A7h, 70h>>

IGraphBuilder STRUCT
pVtbl dd ?
IGraphBuilder ENDS
GraphBuilder IGraphBuilder <?>

invoke CoInitialize, NULL
invoke CoCreateInstance, addr CLSID_FilterGraph, NULL, \
CLSCTX_INPROC_SERVER, addr IID_IGraphBuilder, addr GraphBuilder


to return 0 (S_OK). Am I missing something in the above code?
Posted on 2002-05-19 09:36:46 by grv575
seems correct, except for the IID. Shouldn't it be

IID_IGraphBuilder GUID <56A868A9h, 0AD4h, 11ceh, <0B0H, 3Ah, 0h, 20h, 0AFh, 0Bh, 0A7h, 70h>> ?
Posted on 2002-05-19 10:12:47 by japheth
Whoops. Thanks japhteth, don't see how I over looked that one.
Posted on 2002-05-19 10:37:09 by grv575
Not sure why the following isn't working. The CoCreateInstance returns ok but I'm not able to call any of the interfaces methods.

It looks like the correct vtable is returned (in quartz.dll), but the method isn't the right one or something.

There is a QueryInterface method actually linked into every com dll right?

Can anyone look over the source and tell me what's wrong with the way I'm calling the interface's method?

Click on the about menu item to call the com stuff.

Edit: I believe it should be push offset IID_IMediaControl
Posted on 2002-05-19 15:22:07 by grv575
It looks like the correct vtable is returned (in quartz.dll), but the method isn't the right one or something.


Looks good to me too, just a little strange. Your vtable will add the correct offset, but little else. My tuts show lots of details on how to get this to work.

There is a QueryInterface method actually linked into every com dll right?


Exactly. A QI structure is just about the ONLY requirement of a COM interface.

I believe it should be push offset IID_IMediaControl


Again correct. I don't think I've ever seen a GUID passed by value, always by reference (by an address pointer, OFFSET or ADDR).


Can anyone look over the source and tell me what's wrong with the way I'm calling the interface's method?


Well... since you asked so nicely <g>

It took me a while to realize you're passing IID_IMediaControl by value instead of by reference (and after we both agreed to do it that way too). So the following code runs OK:



push offset MediaControl
push offset IID_IMediaControl
COMETHOD GraphBuilder, IGraphBuilderVtbl.QueryInterface


I didn't check if it really GOT an IMediaControl interface, just that it didn't crash.


Finally... your COMETHOD macro has an extra step in it. You should get your interface pointer in just two MOVs, not three. Sorry, it's too late at night for me to work this detail out.
Posted on 2002-05-19 23:20:15 by Ernie