FW_ObjMgr_CreateInstance

FW_ObjMgr_CreateInstance 1:

This function generates an instance of the class specified by means of Class-ID and at the same time returns an interface pointer to this object.

FW_ObjMgr_CreateInstance 2: Return value

FW_ObjMgr_CreateInstance : HRESULT;

Name

Type

Description

FW_ObjMgr_CreateInstance

HRESULT

Returns S_OK if the function call was successful.

FW_ObjMgr_CreateInstance 3: Inputs

VAR_INPUT
    clsId  : CLSID;
    iid    : IID;
    pipUnk : POINTER TO ITcUnknown;
END_VAR

Name

Type

Description

clsId

CLSID

Specifies the class from which an object should be created.

iid

IID

Specifies the interface ID to which an interface pointer should be referenced.

pipUnk

POINTER TO ITcUnknown

Returns the interface pointer to the created object.

FW_ObjMgr_CreateInstance 4:

Necessary deletion of an object

A generated object must be explicitly deleted again. There is no Garbage-Collector as in .Net. We recommend to use FW_ObjMgr_DeleteInstance, in order to delete the generated instance at the latest in the destructor of the object which created the instance.

Requirements

TwinCAT Version

Hardware

Libraries to be integrated

TwinCAT 3.1, Build 4020

x86, x64, ARM

Tc3_Module