how do i check on the register if an OCX or DLL its correctly regged?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: how do i check on the register if an OCX or DLL its correctly regged?

  1. #1
    Join Date
    Aug 2004
    Posts
    33

    how do i check on the register if an OCX or DLL its correctly regged?

    hi there guys again...

    i was wondering, how can i make a program to check if certain libs are installed and correctly registered in teh registry of Windows?...

    i ask this, cuz i have a proggie that needs certain OCXs, and when some of them are not correctly installed, it gives me an "out of memory" error in my program(besides other weird things you already know...), so, i'd like to add a check in the very begginin of the program, so that wont happen again.

    thx for your help...

    Kaspal.

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    interesting question...
    I use the controls.Add method, and catch the error, but I am wondering myself of a better way
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Aug 2004
    Posts
    33
    do you know where does the Regsrv32.exe program store the keys in teh registry?... maybe by checkin those keys that program creates, its a way to findin out?....

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    the keys are pretty much everywhere in the registry, this is why it is so difficult to find them, and even if they seem correct it is possible that there is a corruption. And, because of the "DLL ****" problem, where every one of us has been before or later, the really only robust way I found to see if a component is registered properly is to try to load it.
    Otherwise... well, it is always possible to open the ocx/dll as a typelib, and get the list of the CLASSID for every public component. Then open the registry and look for those keys in the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID branch, and see if they point to the right executable and right version. A **** of a job...

    EDIT: ops, I have been censored... well, I meant that place that is not heaven
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  5. #5
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You could also use the CoCreateInstance API to try to instantiate the control's CLSID. There's a VB Declare and example here: http://vbnet.mvps.org/code/internet/...torydelete.htm
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Register a DLL in code and Call a function by address?
    By Sean Woods in forum VB Classic
    Replies: 0
    Last Post: 01-11-2002, 04:10 PM
  2. VB Code to Register a DLL
    By Larry Rebich in forum VB Classic
    Replies: 8
    Last Post: 10-30-2001, 12:38 PM
  3. VB Code to Register a DLL
    By Larry Rebich in forum VB Classic
    Replies: 0
    Last Post: 10-29-2001, 10:01 PM
  4. register and unregister dll from windows
    By Tuan in forum VB Classic
    Replies: 6
    Last Post: 04-27-2000, 10:30 PM
  5. register and unregister dll from windows
    By Tuan in forum VB Classic
    Replies: 0
    Last Post: 04-26-2000, 11:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center