Skip to content

Commit

Permalink
SandboxTest: Also load and register the Image3dAPI type library to en…
Browse files Browse the repository at this point in the history
…able marshsaling of the corresponding interfaces.
  • Loading branch information
forderud authored and Fredrik Orderud committed Jul 19, 2022
1 parent feca4a2 commit 760a558
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SandboxTest/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ int wmain(int argc, wchar_t *argv[]) {
}
}

// register type library to enable out-of-proc Image3dAPI calls
// only works if running as admin
CComPtr<ITypeLib> typelib;
HRESULT hr = LoadTypeLibEx(L"Image3dAPI.tlb", REGKIND_REGISTER, &typelib);
CHECK(hr);

#if 0
// unregister type library
TLIBATTR * tlb_attr = nullptr;
CHECK(typelib->GetLibAttr(&tlb_attr));
hr = UnRegisterTypeLib(tlb_attr->guid, tlb_attr->wMajorVerNum, tlb_attr->wMinorVerNum, tlb_attr->lcid, tlb_attr->syskind);
CHECK(hr);
typelib->ReleaseTLibAttr(tlb_attr);
#endif

// create loader in a separate "low integrity" dllhost.exe process
CComPtr<IImage3dFileLoader> loader;
CComPtr<IImage3dSource> source;
Expand Down

0 comments on commit 760a558

Please sign in to comment.