Information Catalog Manager Programming Guide and Reference

FLGGetReg

Retrieves registration information from the information catalog for the specified object type.

Authorization

Administrator or user

Syntax



APIRET  APIENTRY   FLGGetReg( PSZ              pszObjTypeID,
                              PSZ              pszIconFileID,
                              PFLGHEADERAREA * ppObjRegStruct,
                              PFLGEXTCODE      pExtCode );

Parameters

pszObjTypeID (PSZ) -- input
Points to the 6-character, system-generated unique identifier (object type ID) of the object type for which you are retrieving the registration.

pszIconFileID (PSZ) -- input/output
As input, points to the file path and name of the file in which you want to return the OS/2 icon for the registered object type. If this parameter is NULL, the Information Catalog Manager does not retrieve the icon for the registered object type.

As output, points to the file path and name of the file where the Information Catalog Manager stored the OS/2 icon for the registered object type. This pointer is set to NULL if there is no icon associated with the object type registration.

ppObjRegStruct (PFLGHEADERAREA) -- output
Points to the address of the pointer to the output structure.

The output structure contains the property specifications and values of the requested object type registration information. The pointer is set to NULL if FLGGetReg fails.

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.

Output structure

FLGGetReg produces an output structure containing the property specifications and values of the requested object type registration, as shown in Figure 76.

The object area of the output structure contains the values of the registration properties for the requested object type.

Figure 76. FLGGetReg output structure


Figure FLAA2019 not displayed.

For an explanation of the meanings of the byte offsets, see The Information Catalog Manager API output structure.

Usage

Restrictions

You can only retrieve an OS/2 icon using FLGGetReg. To retrieve a Windows icon, use FLGManageIcons (see FLGManageIcons).

Prerequisites

The value in the pszObjTypeID parameter must refer to an existing object type ID registered in the information catalog.

Freeing memory allocated for an output structure

If FLGGetReg returned data in the output structure, you must save the data returned in the output structure and then call FLGFreeMem (see FLGFreeMem). Do not use other methods, for example, C language instructions, to free memory.

Examples

Figure 77 shows the C language code required to issue the FLGGetReg API call. This sample code retrieves information about the registration for the MYIMAGE object type from the information catalog.

Figure 77. Sample C language call to FLGGetReg

 
 APIRET         rc;                    // Declare reason code
 UCHAR          pszObjTypeID[FLG_OBJTYPID_LEN+1]; // Unique ID for MYIMAGE ObjType
 UCHAR          pszIconFileID[FLG_ICON_FILE_ID_MAXLEN+1]; // Path/File name for ICON
 PFLGHEADERAREA * ppObjRegStruct;      // Ptr to pointer to the output structure
 FLGEXTCODE     ExtCode = 0;                // Declare extended code
   .
   .  /* Retrieving an object Type Registration Instance  */
   .
 
 strcpy (pszObjTypeID,"000044");
 strcpy (pszIconFileID,"Y:\\FLGICON2.ICO");
 
 rc = FLGGetReg    (pszObjTypeID, // id of the object type
                      pszIconFileID,// Path/File name of file to contain ICON
                      ppObjRegStruct,// Structure pointer where out  put will be returned
                      &ExtCode);          // Pass pointer to extended code
 

Figure 78 shows the output structure that contains the property and value information for the registration of the MYIMAGE object type.

Figure 78. Sample output structure for FLGGetReg


Figure FLAA2020 not displayed.

In this example, bytes 33 through 38 of the header record contain the object type ID (000044) of the object type for which registration information has been retrieved. It matches the object type ID specified as input in the pszObjTypeID parameter.


[ Top of Page | Previous Page | Next Page ]