How does an ActiveX component get auto-registered

Does an ActiveX component get auto-registered (when first launched by a browser) by the regsvr32 utility, and if so, where does this utility come from?  Should it be part of IE4 or the OS?

I have a comercial app that I can modify to use ActiveX controls.  These controls will be auto-registered when the form is first loaded by a program called regsvr32.  Many of my client PCs do not have this utility.  So I wonder if this is the same utility that auto-registers ActiveX components seen by a browser and where does regsvr32 come from if many clients don't have it.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ActiveX is an open integration platform that provides developers, users, and Web producers a fast and easy way to create integrated applications and content for the Internet and Intranets. Using ActiveX, you can easily insert multimedia effects, interactive objects, and sophisticated applications into a Web page, creating a user experience comparable to that of high quality multimedia CD-ROM titles.

ActiveX is a standard that enables software components to interact with one another in a networked environment, regardless of the language(s) used to create them. Most World Wide Web (WWW) users will experience ActiveX technology in the form of ActiveX controls, ActiveX documents, and ActiveX scripts.

ActiveX Controls
ActiveX controls, formerly known as OLE controls or OCX controls, are components (or objects) that you can insert into a Web page or other application so that you can reuse packaged functionality that someone else programmed. For example, the ActiveX controls that are included with Microsoft Internet Explorer allow you to enhance your Web pages with sophisticated formatting features and animation.

A key advantage of ActiveX controls over Java applets and Netscape plug-ins is that ActiveX controls can also be used in applications written in many programming languages, including all of the Microsoft programming and database languages.

ActiveX Documents
When browsing with an ActiveX-aware Web browser, such as Microsoft Internet Explorer, ActiveX documents enable you to open an application with its own toolbars and menus available. This means you can open non-HTML files, such as Microsoft Excel or Microsoft Word files, using an ActiveX-aware Web browser.

ActiveX Scripting
ActiveX scripting supports most popular scripting languages, including Visual Basic Script and JavaScript. ActiveX scripting can be used to integrate the behavior of several ActiveX controls and/or Java applica- tions from the Web browser or server, extending their functionality.

GregoryGrAuthor Commented:
I need to know how an ActiveX component gets "registered" on a machine once the component is activated from within a Web browser.

I wrote an ActiveX component that I embedded within a purchased app.  That app uses "regsvr32" to auto-register the component.  What would IE4 use?
I believe regsvr32 comes with the resource kit, but it could come with lots of things.  For example, I searched for regsvr32.exe on my harddrive and came back with versions in

\program files\devstudio\sharedidebin (shared by all devstudio components)
\program files\devstudio\vss\win32 (Visual Source Safe)
\winnt\system32 (any app could have put it here)
\winnt\system32\inetsrv (Microsoft IIS)

This utility doesn't do anything special.  It basically calls a specific entry point within COM objects (as you know, ActiveX controls are COM Objects).  You say you wrote an ActiveX component.  Look in the main implementation file of your ActiveX control.  You will see a function called DllRegisterServer that takes no parameters.

Basically, regsvr32 loads a COM DLL (or OCX) into memory and calls the DLLRegisterServer function to register the DLL (or OCX) or DLLUnregisterServer to unregister it.  It also shows a message box to show success or failure.

All that to say, you could write your own registration utility that calls DLLRegisterServer to register the control or DllUnregisterServer to unregister it.

As for IE 4.0, for an ActiveX control to be downloaded, a CAB file is usually created with the CAB file containing a compressed version of the OCX and an INF file that coordinates the download and registration of the OCX.  IE 4.0 could be using the Regsvr32 utility, or it could be simply loading the OCX into memory and calling the DLLRegisterServer entry point (that is, doing the job of regsvr32).
GregoryGrAuthor Commented:
Thanks, you have answered my question.

If you change/add your comment as a solution, I'll accept it and close out the question.

Thanks again!
Glad I could help.  See my comments below.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.