We help IT Professionals succeed at work.

What does Regsrv32 do?

stminfo
stminfo asked
on
25,236 Views
Last Modified: 2011-08-18
What are the details, the nuts and bolts of how and what Regsrv32 does?
Comment
Watch Question

Commented:
Hi stminfo,
To make a long story short, most Dynamic Link Libraries (DLL files) need to be "registered" that is, have an entry in the Windows registry for them to work properly.
Regsrv32 is a utility provided with Windows that will take a DLL File, inspect its contents, and add the relevant entries for you in the registry

Dabas
Hello,

REGSVR32 is application provided by the windows OS. This is used to Registered your DLL or OCX component for using in the user developed application. it does an entry in the registry. after word u can create an instance of that component by adding reference of that component into your project.

Sanjeev.

Commented:
REGSVR32 application may be written in VC++ in a few minutes. It loads Dll using LoadLibrary function, find DllRegisterServer or DllUnregisterServer function it it using GetProcAddress, and calls this function. COM Dll contains self-registering code in it. To register/unregister COM Dll all we need is to call it's  DllRegisterServer or DllUnregisterServer function.
i feel the best answer is what the maker and creator of this app says "You can use the Regsvr32 tool (Regsvr32.exe) to register and unregister object linking and embedding (OLE) controls such as dynamic-link library (DLL) or ActiveX Controls (OCX) files that are self-registerable. This may be necessary to troubleshoot some issues with Windows, Microsoft Internet Explorer, or other programs. For example, the following article in the Microsoft Knowledge Base requires you to use Regsvr32.exe to unregister the Wuv3is.dll control before you reinstall it from the Windows Update site: "


It's to register your ActiveX Control in windows so that your application know its existance and then it can call it.

E.g. you may need to use an ActiveX Control downloaded from web in your Visual Basic project.  You can use Regsvr32 to register the control.  Then, e.g., in Visual Basic, you can add this control to your project (Project>Component) and use it just like the default controls
hey dude,

regsrv* is used to register the DLLs you gonna use on your PC without registering the DLLs you cannot use the DLLs .
just drag the file on the regsrv* and it will be registered...

sarbjit
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Fahad PathanTeam Leader

Commented:
HI,
Regsvr32 is system registry file which used to register libraries like .dll, .ocx, etc.
It Differs that what type of file it is, i.e. whether your PC is Stand Alone OR In Network.
Two Different ways to Register the Library File.
Stand Alone:
If the Machine is stand alone and OS is Win 9X then you have to copy your Library File into Windows\System Folder.
If the Machine is stand alone and OS is Above Win 9X then you have to copy your Library File into Windows\System32 Folder.
Network:
Similar Thing To be Taken In consideration but if you have software which is using any library  and that library is on Server then you have give Library's Physical Path, i.e  Server's Path
To Register Any Library You Need To follow Below Steps
Click on Start -> Run.
then type 'regsvr32 <Filename with Physical Path>'
This is a new question from me

general function, that will display message boxes with minimun width and height. If message exceeds minimum width and height, then it should resize and adjust to text.
 
And, for errors, show exlamation, for successful messages show question mark.
 
So, on a high level, the message box function shall look like,
 
displaymessage(tMessage as string, tMessageType, tMessageIcon)
 
thanks and regards

satishpreddy

Commented:
Use the standard MFC MessageBox("message","title",type) function or

AfxMessageBox("message","title",type) ;

The 'type' will determine the icon that is displayed and the type and number of buttons that will be on the box.

The return type is of type Int and its value is determined by the type parameter.

Look up "MessageBox" in help for more info.

Mike
Hi Mike,
 Can u explain the AfxMessageBox in detail with an example regarding my problem.

Thanks and Regards

Commented:
satishpreddy,

The command has the following forms:

int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );

int AFXAPI AfxMessageBox( UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT) -1 );

Return Value

Zero if there is not enough memory to display the message box; otherwise one of the following values is returned:

IDABORT   The Abort button was selected.
IDCANCEL   The Cancel button was selected.
IDIGNORE   The Ignore button was selected.
IDNO   The No button was selected.
IDOK   The OK button was selected.
IDRETRY   The Retry button was selected.
IDYES   The Yes button was selected.

If a message box has a Cancel button, the IDCANCEL value will be returned if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing the ESC key has no effect.

Parameters

lpszText

Points to a CString object or null-terminated string containing the message to be displayed in the message box.

nType

The style of the message box. Apply any of the message-box styles to the box.  

nIDHelp

The Help-context ID for the message; 0 indicates the application&#8217;s default Help context will be used.

nIDPrompt

A unique ID used to reference a string in the string table.



This info is from the MSDN Library for Visual Studio 6.0.

Mike

Commented:
An example of usage:

CString txt = "Display this string";
int ok = AfxMessageBox(txt,MB_OK|MB_CANCEL);
if(ok == IDOK)
{
   ....;
}


The box will be only large enough to contain the message and the 2 buttons that I requested.  You can embed '\n' codes in the text to force multiple line breaks if you wish.

Mike
Hi Mike,
 Your explanation is good but can u use the same function in a project and form and send me that example so that i can understand better. Mike, I asked previously the same only.

Thanks

satishpreddy
Your explanation is good but can u use the same function in a project and form and send me that example so that i can understand better. Mike, I asked previously the same in a visualbasic project only. I work on VisualBasic 6.0

Commented:
'Visual Basic 6.0 Example:

'Insert code into the click event of a button on a form.

Dim ok as Integer

ok = MsgBox("Display this text")

'displays text with an OK button

'displays text with Retry and Cancel buttons
ok = MsgBox("Display this text", vbRetryCancel,"Title")
if ok = vbRetry then
    '.....
elseif ok = vbCancel then
    '......
end if


'See help on the MsgBox for a complete list of parameters.

Mike

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions