
Register/Unregister dll/ocx using API calls
Quote:
> Why don't you just Shell the regsvr32 with the path to the OCX and or
dll?
> > Hello everyone!
> > If you know API calls that register/unregister dll/ocx, please let
me
> > know ASAP.
There are problems with using Shell. You don't know when the
registration has finished, unless you also use the WaitForSingleObject
API. Even if you wait the program can't know whether the registration
succeeded. The user will know because it will show a dialog box.
All regsvr32 does is call the entries DllRegisterServer or
DllUnregisterServer in the DLL/OCX. You can do exactly the same from VB
into your own DLL. Suppose its called MyServer.dll.
Private Declare Function RegMyServer Lib "MyServer"
Alias "DllRegisterServer" () As Long
Result = RegMyServer
The returned result is 0 if the operation succeeded. The extension DLL
for the library is assumed.
--
Roger Abbott, RHA (Minisystems) Ltd - http://www.rhaminisys.com
DDE Client and Server ActiveX controls for Visual Basic
DDE FAQ and DDE utility tools, browser URL monitor,
Program launcher/setup menu, other freeware and shareware
Sent via Deja.com
http://www.deja.com/