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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question - Registering COM Objects

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Hello All, I am new to COM Objects so please be patient.

My question is how to go about actually registering a COM object on the computer, so that you can then access it. I have heard a little bit about various methods, but I am looking for a clear cut process to achieve this. I am a COldFusion developer, so working with COM objects is a very new thing for me, and this is the first time I am attempting this. If anyone can describe the COM registration process, or point me to appropriate FAQ or other resource, it would be greatly appreciated.

Thank You,

RR [yinyang]
 
A properly constructed DLL having COM objects in it can self-register itself. For DLLs, you can use the "regsvr32" program that comes with windows to invoke the DLL self-register function. It is a command-line program. Open a command line, change to the directory where your DLL is located, and run:

Code:
regsvr32 myobject.dll

Where "myobject.dll" is the name of your DLL.

For an EXE with COM objects, register the objects by running the program with the "/RegServer" command line option:

Code:
myobject.exe /RegServer

If you're not sure how to build the EXE or DLL in the first place, so that it supports self-registration, the best place to start, in my opinion, is to read a good book about COM. If you're in a hurry, use something like Visual C++ to create a new COM object project. This will generate a working skeleton of an EXE or DLL that comes with the self-registration code built-in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top