Skip to content

TObject.GetInterfaceByStr

Return an interface based on its GUID

Declaration

Source position: objpash.inc line 247

public 
  function GetInterfaceByStr(const iidstr: shortstring; out obj) : Boolean;

Description

GetInterfaceByStr returns in obj a pointer to the interface identified by iidstr. The function returns True if the interface is indeed implemented by the class, or False otherwise.

The iidstr is the unique GUID by which the interface was declared.

Errors

The function returns false if the requested interface is not implemented.

See also

Name Description
TObject.GetInterfaceEntry Return the interface table entry by GUID
TObject.GetInterfaceEntryByStr Return the interface table entry by string