Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking to see if a dll/ocx was successfully registered 2

Status
Not open for further replies.

jstiegelmeyer

Programmer
Dec 31, 2002
27
US
Through product updates, I am using Visual Basic and Windows API to register new dll's and ocx's on my clients' machines. For obvious reason, I want regsvr32 to execute silently, but then I need a way to confirm that the registration was successful.

This is the line of code that I use to execute regsvr silently.

ShellExecute 0, "open", "regsvr32", "/s """ & strFilePath & """", "", 0

Does anyone know of an API call that I can use to confirm that each component is successfully registered? If not, is there anyway to capture/trap the information from the line of code above?

Thanks in advance,
Jamie
 
I think that what regsvr32 does is just calling DllRegisterServer on the dll/ocx in question. You could do this yourself and check the return value for success/failure.
Greetings,
Rick
 
Rick,

Could you explain what you mean by doing it myself? I have to do it through Visual Basic because I'm sending a patch to client computers. How do I check the return value for success/failure?

Thanks,
Jamie
 
Jamie,

By doing it yourself I mean; call the DllRegisterServer in the COM server you want to register yourself from within your VB app. You can check the return value of this method to see if had has registered successfully.
DllRegisterServer is just a method that is exported by in process COM servers, which instructs the server to register itself.
Greetings,
Rick
 
Are you saying there's a com object inside of VB that registers dlls? If so, what is it called? I didn't see a component named DllRegisterServer. The closest possibility I found was called "RegwizCtrl 1.0 Type Library".

Thanks for your patience,
Jamie
 
No, that's not exactly what I meant.
Check the MSDN for DllRegisterServer. It's just a plain old API (this method as nothing to do with COM whatsoever, besides the fact that it instructs the dll to register itself). It cannot be a COM object, since the COM server is not yet registered, so access to it as a COM server is not yet possible. You should just treat it like you would treat any ordinary dll call, that is:

Private Declare function DllRegisterServer lib "your dll name" () as Long.

At least, that's what I think is necessary (I cannot think of any other way and I think that this is the same call that regsvr32 makes, only regsvr32 gives you feedback in messageboxes, which you do not want).
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top