c - How to get licensed COM object via CreateInstanceLic? -


i'm trying access com of licensed server, i'm using iclassfactory2 so. here code far:

// ... iclassfactory2 class_factory; hr = cogetclassobject(     &clsid,     clsctx_local_server,     null,     &iid_iclassfactory2,     (lpvoid*) &class_factory ); if (hr != s_ok) { return 1; } // ... hr = class_factory.lpvtbl->createinstancelic(     &class_factory,     null,     null,     &iid_idispatch,     key,     (lpvoid)&dispatch ); // ... 

however, call createinstancelic segfaults.

exception thrown @ 0x00000001 in consoleapplication1.exe: 0xc0000005: access violation reading location 0x00000001. 

i think reason class_factory.lpvtbl looks this:

    queryinterface  oleaut32.dll!0x75769edc (type information missing symbol file) hresult(__stdcall*)(iclassfactory2 *, const _guid * const, void * *)     addref  0x00000001  unsigned long(__stdcall*)(iclassfactory2 *)     release 0x00401074  unsigned long(__stdcall*)(iclassfactory2 *)     createinstance  0x003f67a0  hresult(__stdcall*)(iclassfactory2 *, iunknown *, const _guid * const, void * *)     lockserver  0x003e777c  hresult(__stdcall*)(iclassfactory2 *, int)     getlicinfo  0x003e7778  hresult(__stdcall*)(iclassfactory2 *, taglicinfo *)     requestlickey   0x757e60c4 {oleaut32.dll!_gpfactory}    hresult(__stdcall*)(iclassfactory2 *, unsigned long, wchar_t * *)     createinstancelic   0x00000001  hresult(__stdcall*)(iclassfactory2 *, iunknown *, iunknown *, const _guid * const, wchar_t *, void * *) 

i kinda feeling 0x00000001 not valid address createinstancelic should located. i'm doing wrong have no idea what.

so should be:

iclassfactory2 * class_factory; hr = cogetclassobject(     &clsid,     clsctx_local_server,     null,     &iid_iclassfactory2,     &class_factory ); if (hr != s_ok) { return 1; } // ... idispatch * dispatch; hr = class_factory.lpvtbl->createinstancelic(     &class_factory,     null,     null,     &iid_idispatch,     key,     &dispatch ); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -