I'm glad that my guidance to use the Activation Context API solved the problem. And it was especially good to read that you implemented the solution yourself. Good job!
How to dynamically load a registration-free COM DLL in C++?
With the previous question I figured out how to use the registration free COM with everyone's help. (Previous Question) But a new problem has arisen. The current situation is that the program needs to be in the same directory as the DLL generated by the COM library in order to run, and if the DLL is missing the program will not start and will report an error.
[Window Title]
C:\Users\AlanCRL\Desktop\CSRegFreeComServer.exe
[Content]
C:\Users\AlanCRL\Desktop\CSRegFreeComServer.exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
[OK]
At present it seems that Activation Context API can solve my problem, probably dynamic loading COM components, at that time I would like to ask you to help me write a sample code, or modify my project has reached the requirements, thank you. Download the project here.