// COMClient.cpp : Defines the entry point for the console application. //
#include "stdafx.h" #include "..\dave_idl_i.c"
int main(int argc, char* argv[]) { HRESULT hr; IJack *pIJ; IClavdivs *pIC;
CoInitialize(NULL); hr = CoCreateInstance(CLSID_DaveComponent, NULL, CLSCTX_INPROC_SERVER, IID_IJack, reinterpret_cast<void**>(&pIJ)); if (FAILED(hr)) printf("CoCreateInstance IJack failed!\n"); else printf("CoCreateInstance IJack succeeded\n");
hr = pIJ->QueryInterface(IID_IClavdivs, (void**) &pIC); if (FAILED(hr)) printf("pIC->QI failed!\n"); else printf("pIC->QI succeeded\n");
pIJ -> Test(); pIC -> DisplayStuff();
pIJ -> Release(); pIC -> Release();
printf("All Done!\n"); CoUninitialize(); return 0; }