Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Live Template
templateAPI Function Template

Registers a new component with the host framework. Typically you will call this from within Initialise or InitialiseGUI.

Syntax

Code Block
languagecpp
int RegisterComponent(
HostModuleHandle module,
ComponentEntry* entry
);

 

Parameters

Vardef
Namemodule
TypeMod*
Linkedtrue
TypeHostModuleHandle
StyleParameter

Internally managed handle of the module to register this component under. Calls to Initialise and InitialiseGUI are passed a HostModuleHandle that is created and managed by the framework. Pass this same handle to RegisterComponent. e.g.

Code Block
languagecpp
static ComponentEntry ourComponent;
 
extern "C" __declspec(dllexport) int Initialise(HostAPI* pHost, HostModuleHandle hModule, LPCWSTR szRegistryPath)
{
	// Initialisation of ourComponent removed for brevity 

	return RegisterComponent(hModule, &ourComponent);
}

Vardef
Nameentry
TypeMod*
Linkedtrue
TypeComponentEntry
StyleParameter

Pointer to the ComponentEntry object that you wish to register.

Returnvalue
Typeint

Non-zero if the component is registered successfully, or zero if registration failed.

 

Remarks

See Also

ComponentEntry

HostModuleHandle