1

I have a Windows application which should run from USB and is not allowed to install any software on the local PC. The application uses MSXML version 4 and thus requires the msxml4.dll.

In the code the application uses the Windows COM to instantiate (CreateInstance/CoCreateInstance) the XML document/element objects and the COM does (somehow magically) load the required dll for me at runtime. As far as I understand, COM requires the dll to be registered with the regsvr32 tool to find it and successfully load it. The problem is that I am not allowed to run the regsvr32 tool and I also do not want to do this since it would change the system registry (I guess).

But what if I am not allowed to register any dll to the system, is there a way to tell COM that there is a dll which it should use only temporarily? I know about DLL redirection, but this only works if the dll was registered before.

bender
  • 613
  • 1
  • 8
  • 23

1 Answers1

0

What you guess about COM is right, It use the registry information (indexed by GUID) to load DLL and create instance for you. I do not think you can bypass the COM without register the DLL. you should try to use other DLL without COM to handle XML in your application.

If my memory serve me correctly, the COM DLL will hide all the symbol of your instance, i.e you can not load it dynamically.

gzh
  • 3,507
  • 2
  • 19
  • 23
  • [The link in Related](http://stackoverflow.com/questions/2187425/how-do-i-use-a-com-dll-with-loadlibrary-in-c?rq=1) can be a reference for you. – gzh Feb 12 '16 at 09:26