Avoid DLL hell by using Reg-free techology

Our component like htmlsnapshot and activetts are based on COM. Traditionally you need to register the COM control on client machines to make the COM object usable in your application. But since Windows XP or Windows 2003, a new Reg-free COM activiation model is introduced which is to store the COM dll in the current folder of application and use a application specific manifest file to tell how to create the COM object. For details, pelase read the MSDN article. To give an example on how to use Reg-free method for our html snapshot component, you can try this:

1. Install our html to image component

2. The htmlsnap2.dll is automatically registered when installing. Run GetPageVB6.exe, it should work

3. Now, to do the experiment, unregister the htmlsnap2.dll, run  the command line:

regsvr32 /u htmlsnap2.dll

Now the GetPageVB6.exe cannot work since the ActiveX is not registered in registery.  A runtime error

 ”————————— Project1 ————————— Run-time error ’429′: ActiveX component can’t create object ————————— OK  ————————— will appears.

 4. Now, create a manifest named GetPageVB6.exe.manifest 

Run the program again, you will see it runs correctly again. That is so called Reg-free COM.

5. This method applies to .Net application as well. So this means you no longer need to register COM in registry before use.