[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to find out if a dll is registered or not ?

Posted on 2006-07-14
5
Medium Priority
?
579 Views
Last Modified: 2010-04-05
Hi.

I'd like to send a command
regsvr32 /u  ***.dll

but only if it is registered.
Is there a way to find out programmatically ?

Thanks in advance.
0
Comment
Question by:CodedK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17108003
I found this:
http://www.developerfusion.co.uk/show/3479/
and another idea:
http://experts.about.com/q/Visual-Basic-1048/DLL-OCX-Registered.htm
and another thread:
http://forums.winamp.com/showthread.php?threadid=181974 (didn't read throu)

you could also try to move the dll, or to rename it and trap error
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17108079

Have you checked out the tip on my site:

http://users.adelphia.net/~rllibby/delphitips/tip8.html

regarding programmatically registering / unregistering a library? You can use this class to determine if a dll exposes the required functions, and there is no problem with unregistering a library that is not registered (most just remove any registry keys they created). The functions return an HRESULT (no error messages, exceptions), so you choose how you want to handle the return, if at all.

Regards,
Russell
0
 
LVL 16

Author Comment

by:CodedK
ID: 17108333
Ciuly thanks, i've read the articles, the source code in DeveloperFusion (Is it in C ?)
probably talks about looking if a dll can be loaded, if it is available...(Maybe i'm wrong...).
But mine is a windows component, its available.
I'd like to learn the current state.

Russell i've tracked the registry changes (registering/unregistering the dll)...
You are right, i can do without regsrv. I can just change the registry keys with you "RegTransfer" unit.

Just to be on the safe side i'd like to try COMREG unit ...
Can you give me an example of how to :
Check if it is available, load it and unload it ?

Thanks :)
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 1000 total points
ID: 17108479
Very simple to use, let me know if you have questions.

Russell


Example:

  with TComRegistration.Create do
  begin
     try
       // Set lib name to the name of the dll you are working with
        if (Load(LibName) = ERROR_SUCCESS) and IsLoaded and IsComLibrary then
        begin
           if (Perform(raUnregister) = S_OK) then
           begin
              ShowMessage('Unregistered');
           end;
        end;
     finally
        Free;
     end;
  end;
0
 
LVL 16

Author Comment

by:CodedK
ID: 17108577
Thank you both :)

Russell it works perfect, i can handle the messages now which is good :)
But more or less it does the same thing as the code in DeveloperFusion, it checks
for the existence of the file...
If it manage to load it then ok it exists... Anyway i can track it through registry and then load itwith your
unit  :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question