|
-
Sep 26th, 2001, 05:41 AM
#1
Thread Starter
Hyperactive Member
Unregister and Delete Dlls programmatically
Hi,
I am writing an application that will Unregister and delete the Dlls in a given directory structure. I tried this in 2 ways but am having problems in both.
1) I tried the ShellExecute to do this using the "open" verb but this resulted in the successful/unsuccessful Notification message. The appln would be functioning for a batch of DLLs and I don't want a notification to be sent. Is this possible? How do i disable notifications?
VB Code:
l = ShellExecute(Me.hwnd, "Open", "c:/Winnt/system32/regsvr32.exe /u", "D:/Dlls/xxxx.dll", "c:/", SW_HIDE)
2) Secondly I tried this code borrowed from an article posted by Clunietp. Here the difficulty i encountered was that the Dll had to be hardcoded in the Declaration Statement itself. Anyone has any ideas on how the DLL can be passed as an argument to a similar API Call?
VB Code:
Private Declare Function UnRegComCtl32 Lib "D:/DLLs/xxxx.dll" _
Alias "DllUnregisterServer" () As Long
Also, I want ways to clean the registry entries - Class IDs of the deleted DLLs. Any ideas?
thanks,
Jemima.
Last edited by JemimaChadwick; Sep 26th, 2001 at 05:45 AM.
-
Sep 26th, 2001, 10:31 AM
#2
This code sample gets around the hard-coded problem for calling DllUnRegister or DllRegister - from allapi.net
http://www.allapi.net/apilist/exampl...er%20Server%20(2)
-
Sep 26th, 2001, 10:38 AM
#3
Addicted Member
Try adding the /s option to your regsvr32 call...
VB Code:
l = ShellExecute(Me.hwnd, "Open", "c:/Winnt/system32/regsvr32.exe /s /u", "D:/Dlls/xxxx.dll", "c:/", SW_HIDE)
Also jims link is broken... try this one: http://www.allapi.net/apilist/exampl...20Server%20(2)
Hope this helps
Michael
Last edited by Michael Woolsey; Sep 26th, 2001 at 10:42 AM.
Application/Web Developer
Visual Basic 6.0 SP5
Active Server Pages
Oracle 9i
- I'm going to live forever, or die trying!
-
Sep 27th, 2001, 01:28 AM
#4
Thread Starter
Hyperactive Member
Ultimate!
Thanks Michael. That did it!
Thanks to u too, jim. But my app terminates with a VBSTAT.exe Application Error on call to
VB Code:
CallWindowProc(pa, hWnd, ByVal 0&, ByVal 0&, ByVal 0&)
Anyhow, now everything's fine! I got the app working.
Still, What about the Registry? Even if I unregister and delete Dlls this way, the class-id(s) would remain in the registry right? Anyone know any application or code for cleaning the registry from "hanging references"?
- Jemima.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|