Page tree

Versions Compared

Key

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

The structure that defines a component within WinGate. You pass a pointer to a ComponentEntry object to RegisterComponent in order to register your component with the host (WMC or WinGate Engine).

Structure

Code Block
languagecpp
struct ComponentEntry
{
	unsigned long dwSize;							// size of this structure
	GUID	guid;									// UUID of the component
	WCHAR	szName[COMPONENT_MAXNAME + 1];			// display name of the component
	unsigned long dwComponentVersion;				// version of the component for version checking modules etc
	bool	bPublic;								// is this component public?
	HostComponentHandle hHostPrivate;				// context handle used by Host to associate with the component
	ComponentContextHandle hComponentPrivate;		// context handle used by component to associate with the Host
	QueryInitInterfacesFunc QueryInitInterfaces;	// OPTIONAL: query a component to see if its dependencies for initialisation are met
	InitInterfacesFunc		InitInterfaces;			// OPTIONAL: triggers registration of interfaces, if you have any, you need this
	NotifyFunc				Notify;					// OPTIONAL: receives notifications, should be NULL if notifications not required
	StartFunc				Start;					// OPTIONAL: start a component service.
	StopFunc				Stop;					// OPTIONAL: stop a component service
	StoreFunc				Store;					// OPTIONAL: Store a component configuration
	LoadFunc				Load;					// OPTIONAL: Load a component configuration
};

 

Members

Vardef
NamedwSize
Typeunsigned long
StyleMember

The size in bytes of the ComponentEntry structure.

Vardef
Nameguid
TypeGUID
StyleMember

The UUID of the component.

Vardef
NameszName
TypeWCHAR
StyleMember

The null-terminated name of the component that's displayed to the user.

Vardef
NamedwComponentVersion
Typeunsigned long
StyleMember

The version number of the component. This value is displayed in the Modules panel inside the WinGate Management Console.

Vardef
NamebPublic
Typebool
StyleMember

Specifies whether this component is public. Public components will notify other modules of their existence via their own ComponentEntry.Notify callback.

Vardef
NamehHostPrivate
Linkedtrue
TypeHostComponentHandle
StyleMember

Used by the framework internally. Do not modify.

Vardef
NamehComponentPrivate
Linkedtrue
TypeComponentContextHandle
StyleMember

A space for some private data to be stored by your component for access in functions that pass you a ComponentEntry * such as Notify and InitInterfaces  among others.

Vardef
NameQueryInitInterfaces
Linkedtrue
TypeQueryInitInterfacesFunc
StyleMember

Pointer to the function to query whether the interfaces for the component can be initialised. See Remarks

Vardef
NameInitInterfaces
Linkedtrue
TypeInitInterfacesFunc
StyleMember

Pointer to the function that initialises the component's interfaces. This will not be called by the framework unless ComponentEntry.QueryInitInterfaces has returned true;

Vardef
NameNotify
Linkedtrue
TypeNotifyFunc
StyleMember

Pointer to the function that receives notifications from the framework.

Vardef
NameStart
Linkedtrue
TypeStartFunc
StyleMember

Starts the component

Vardef
NameStop
Linkedtrue
TypeStopFunc
StyleMember

Stops the component

Vardef
NameStore
Linkedtrue
TypeStoreFunc
StyleMember

Instructs the component that it needs to store its configuration.

Vardef
NameLoad
Linkedtrue
TypeLoadFunc
StyleMember

Instructs the component that it needs to refresh its configuration.

 

Remarks

...

Before a component has its interfaces initialised by a call to InitInterfaces, QueryInitInterfaces is called to see whether it is ready. A component can use this to wait until all components it is dependent on have had their interfaces initialised first. The general flow if component interface initialisation is as follows:

Requirements

See Also

QueryInitInterfaces

ComponentEntry Callbacks

Live Template
templateAPI Structure