CLSID$

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > String functions >

CLSID$

 

Description

 

Return a 16-byte GUID string (128-bit GUID format string) containing a CLSID associated with a unique ProgramID string of a COM object or component.

 

 

Syntax

 

s = CLSID$(ProgramId)

 

Returns

 

String

 

Parameters

 

Name

Type

Optional

Meaning

ProgramId

String

No

A string representing the program id of a COM object/component.

 

The ProgramID parameter is not case-sensitive, so "MSAGENT.CONTROL.2", "MSAgent.Control.2" and "msagent.control.2" all refer to the same COM object/component.

 

Remarks

 

A CLSID string is a 128-bit (16-byte) binary string representing the GUID or UUID of a COM object/component.

 

A CLSID string is not in a human-readable format.

To convert the binary CLSID string into human-readable GUID/UUID format, use the GUIDTXT$ function.

 

CLSID$ is the complement to the PROGID$ function.

 

If the ProgramID cannot be found, or if any error occurs during the lookup and conversion process, CLSID$ will return an empty string.

 

Restrictions

 

See also

 

PROGID$

 

Examples

 

uses "Console"

 

DIM MSWordClassID AS GUID

 

MSWordClassID = CLSID$("Word.Application")

IF TRIM$(MSWordClassID, $NUL) <> "" THEN

 

  '---Success getting the CLSID$ of MSWord

  Printl "ProgID:"PROGID$(MSWordClassID)

 

  '---

  PrintL "ClsId: "GUIDTXT$(MSWordClassID)

 

Else

  printl "It seems Microsoft Word is not installed."

END IF

 

printl "---Al done press a key to end---"

WaitKey