Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DummyLoader: Skip registering the interfaces as part of the loader #177

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

forderud
Copy link
Member

@forderud forderud commented Jul 18, 2022

Done to prevent the loader from "hijacking" the registration of the IImage3dSource and IImage3dFileLoader interfaces that should really be the responsibility of the "host" SW to register.

How SW implementation suggestion

Host SW that already registers COM classes can just add the IImage3dSource and IImage3dFileLoader to the library section of their IDL file to auto-register the interfaces.

Host SW that is not registering any COM classes can instead add the following C++ code:

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

@forderud forderud marked this pull request as draft July 18, 2022 16:04
@forderud forderud changed the title DummyLoader: Skip registering the Image3dApi interfaces as part of the loader DummyLoader: Skip registering the interfaces as part of the loader Jul 18, 2022
@forderud forderud force-pushed the DummyLoader-tlb-reg-skip branch 7 times, most recently from ad7b33d to 257a608 Compare July 19, 2022 11:30
Fredrik Orderud and others added 2 commits July 19, 2022 13:33
…e loader

Done to prevent the loader from "hijacking" the registration of the IImage3dSource and IImage3dFileLoader interfaces that should really be the responsibility of the "host" SW to register.
…d of the loader.

This depends on Image3dAPI.tlb being found in the system PATH.
@forderud forderud force-pushed the DummyLoader-tlb-reg-skip branch from 257a608 to 760a558 Compare July 19, 2022 11:34
Copy link

@jogerh jogerh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes quite a lot of sense. I agree that it should be the responsibility of the host to register the interfaces that it provides. But do you see this as a change that we would implement for all loaders, or just for the dummy loader?

DummyLoader/Main.cpp Outdated Show resolved Hide resolved
DummyLoader/Main.cpp Outdated Show resolved Hide resolved
…able marshsaling of the corresponding interfaces.
@forderud forderud force-pushed the DummyLoader-tlb-reg-skip branch from 760a558 to 78e1890 Compare August 4, 2022 11:47
@forderud
Copy link
Member Author

forderud commented Aug 4, 2022

This makes quite a lot of sense. I agree that it should be the responsibility of the host to register the interfaces that it provides. But do you see this as a change that we would implement for all loaders, or just for the dummy loader?

All loaders will likely need to be updated the same or in a similar way. Hosts may also need to be updated to ensure that they're instead registering the interfaces if not done by the loaders any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants