System.Win.ComObj.TComObjectFactory.RegisterClassObject

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure RegisterClassObject;

C++

void __fastcall RegisterClassObject();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Win.ComObj.pas
System.Win.ComObj.hpp
System.Win.ComObj TComObjectFactory

Description

Registers the COM class associated with the factory object.

RegisterClassObject registers an EXE class object with OLE so other applications can connect to it. EXE object applications should call RegisterClassObject on startup. It can also be used to register internal objects for use by the same EXE or other code (such as DLLs) that the EXE uses.

If RegisterClassObject is not successful, an EOleSysError is raised with the following error code possibilities:



Value Meaning

E_INVALIDARG

One or more the arguments are invalid.

E_OUTOFMEMORY

Not enough memory.

E_UNEXPECTED

An unexpected error occurred.

CO_E_OBJISREG

The class was already registered in the class object table.



Only EXE object applications call RegisterClassObject. Object handlers or DLL object applications do not call this function. Instead, they must implement and export the DllGetClassObject function.

At startup, a multiple-use EXE object application must create a class object (with the IClassFactory interface on it), and call RegisterClassObject to register the class object. Object applications that support several different classes (such as multiple types of embeddable objects) must allocate and register a different class object for each.

Multiple registrations of the same class object are independent and do not produce an error. Each subsequent registration yields a unique key.

See Also