When/how is DllRegisterServer called? RRS feed

  • Question

  • I am experimenting with writing a preview handler. When and how is the DllRegisterServer function called in the preview handler DLL?


    Saturday, May 12, 2012 11:53 PM


  • This is called when you run regsvr32 <yourdllname>.

    DllRegisterServer is a self registration function, there should be DllUnregisterServer there too. They are used as an installation/uninstallation mechanism. Once your preview handler is installed on your system, this function is never called again.

    The function DllUnregisterServer is also only called when you run regsvr32 /u <yourdllname>.

    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.

    Sunday, May 13, 2012 12:13 AM