NO

Author Topic: WTypeLibList  (Read 5288 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
WTypeLibList
« on: June 22, 2017, 05:27:32 PM »
Updated version of WTypeLibList.
  • enums are moved to second after forward declarations in header file
  • struct GUID is saved as GUID
  • option to correct GUID in QueryInterface to REFIID
these modifications was for typelib like in a quartz.dll

test program for headers
Code: [Select]
#define WIN32_LEAN_AND_MEAN
//#include <dshow.h>
#include <ole2.h>
#include "quartz.h"
#include "qedit.h"
#pragma comment(lib, "ole32.lib")
// http://doc.51windows.net/Directx9_SDK/?url=/Directx9_SDK/htm/imsvidctlinterface.htm
const GUID CLSID_FilterGraph = {0xe436ebb3,0x524f,0x11ce,{0x9f,0x53,0x0,0x20,0xaf,0xb,0xa7,0x70}};
const GUID IID_IGraphBuilder = {0x56a868a9,0xad4,0x11ce,{0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70}};
const GUID IID_IMediaControl = {0x56a868b1,0xad4,0x11ce,{0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70}};
const GUID IID_IMediaEvent = {0x56a868b6,0x0ad4,0x11ce,{0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70}};

int main(void)
{
IGraphBuilder *pGraph = NULL;
IMediaControl *pControl = NULL;
IMediaEvent *pEvent = NULL;
// Initialize the COM library.
HRESULT hr = CoInitialize(NULL);
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (void **)&pGraph);
if (pGraph)
{
hr = pGraph->lpVtbl->QueryInterface(pGraph, &IID_IMediaControl, (void **)&pControl);
hr = pGraph->lpVtbl->QueryInterface(pGraph, &IID_IMediaEvent, (void **)&pEvent);
// Build the graph. IMPORTANT: Change this string to a file on your system.
hr = pGraph->lpVtbl->RenderFile(pGraph, L"video.avi", NULL);
if (SUCCEEDED(hr))
{
// Run the graph.
hr = pControl->lpVtbl->Run(pControl);
if (SUCCEEDED(hr))
{
// Wait for completion.
long evCode;
pEvent->lpVtbl->WaitForCompletion(pEvent, INFINITE, &evCode);
// Note: Do not use INFINITE in a real application, because it
// can block indefinitely.
}
}
pEvent->lpVtbl->Release(pEvent);
pControl->lpVtbl->Release(pControl);
pGraph->lpVtbl->Release(pGraph);
}
CoUninitialize();
return 0;
}
« Last Edit: June 27, 2017, 08:25:55 AM by TimoVJL »
May the source be with you

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: WTypeLibList
« Reply #1 on: June 23, 2017, 02:11:22 AM »
What's going on, Timo? A revival of DirectShow??  ;)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: WTypeLibList
« Reply #2 on: June 26, 2017, 07:46:38 PM »
I just updated code again for Pelle's nice code for COM interface. (WTypeLibList3_WS_a1.zip)

So why download a huge SDK for a small header file, when we can have a good typelib, that gives you most of details for a header file?

I hope that people inform us about dll/ocx where we can find useful info.
Don't forget FTypeLib

BTW:
This way i give something back to Pelle to his great work.
Sure i have also given some with PayPal too ;)

EDIT:
qedit.h needs additional fixes:
rename _PinDirection to PIN_DIRECTION
rename _AMMediaType to AM_MEDIA_TYPE
 comment out between
Code: [Select]
/*
typedef struct _LARGE_INTEGER {
...
} _FILETIME;
*/
« Last Edit: September 25, 2023, 10:24:05 AM by TimoVJL »
May the source be with you