Well, you can manually register things like DLLs and OCXes from the
Start/Run command of the task bar using "regsvr32.exe filename" or
"regsvr32.exe /u Filename" to unregister, but by far the easiest way is
to copy this code into a new text file called "RegisterOCXsAndDLLs.reg"
and then double click on it, which will put some stuff into the
registry which will allow you to register and unregister files simply
by right clicking on them in Windows Explorer and selecting Register or
Unregister from the popup context menu. Note that some DLL's can't be
registered and some can. If it can't, don't worry about it because it
doesn't need to be - you just declare it in your code and call it.
I would think your setup project in your solution should do the
registering for you. You can use the built-in installer maker in
VS2005 or get a separate one like Wise or Install Shield. I prefer
Wise.
Reviewing:
1. Open Notepad or Wordpad with a new text file, copy the following
into it, save it as RegisterOCXsAndDLLs.reg.
2. Double-click RegisterOCXsAndDLLs.reg and say yes when it asks you if
you want to change the registry.
3. In Windows Explorer, browse to your DLL or OCX. Right-click on it
and select Register or Unregister.
;========================================================
REGEDIT4
; This adds the ability to Right-Click on a .dll or .ocx
; and get the Register / UnRegister options.
;
; If it doesn't work for you, mail me and tell me about it.
; Jon Evans <
[email protected]>
; ==========
; .DLL files
; ==========
[HKEY_CLASSES_ROOT\.dll]
"Content Type"="application/x-msdownload"
@="dllfile"
[HKEY_CLASSES_ROOT\dllfile]
@="Application Extension"
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister\command]
@="regsvr32.exe /u \"%1\""
; ==========
; .OCX files
; ==========
[HKEY_CLASSES_ROOT\.ocx]
@="ocxfile"
[HKEY_CLASSES_ROOT\ocxfile]
@="OCX"
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister\command]
@="regsvr32.exe /u \"%1\""
; End
;========================================================