Search code examples
windowsdeploymentoleocx

How do I deploy a utility with ocx dependency to a test machine without registering the ocx?


I have a test utility that depends upon an ocx file that is installed/registered on my development machine. We'd like to run this tool on a test machine without polluting the machine with any unnecessary files. Nothing should be installed except the target machine software. Running the tool on a network drive or from a stand-alone directory copied to the test machine would be ideal. But, registering the ocx on the test machine is out of the question. Placing the ocx file in the same directory as the exe doesn't work. No matter what it still gives me this error--"The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem." What else can I try? FYI, I'm using Visual Studio 2008.


Solution

  • If we are talking about Windows XP+, then Microsoft has a capability called Reg-Free COM. Basically you create a manifest file for your EXE that calls into your DLL/OCX and it has all the registration information needed to make the COM call without actually registering it in HKCR.

    http://msdn.microsoft.com/en-us/library/ms973913.aspx