Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IStringTable::AddString method

The IStringTable::AddString method enables a snap-in to add a string to the snap-in's string table.

Syntax


HRESULT AddString(
  [in]  LPCOLESTR     pszAdd,
  [out] MMC_STRING_ID *pStringID
);

Parameters

pszAdd [in]

The string to add to the string table.

pStringID [out]

A pointer to the ID of the string added to the string table.

Return value

This method can return one of these values.

S_OK

The specified string was successfully added to the snap-in's string table.

E_INVALIDARG

pszAdd or pStringID point to invalid memory locations.

E_OUTOFMEMORY

There is not enough memory to add the string to the snap-in's string table.

Remarks

Strings in the string table are reference counted. For example, adding the string "My Text" to the string table will return an ID, say 1234. Adding "My Text" to the string table a second time will return an ID of 1234 again, and the internal reference count for the string will be incremented. Two calls to IStringTable::DeleteString, or a single call to IStringTable::DeleteAllStrings, will be required to completely remove "My Text" from the snap-in's string table.

IStringTable::AddString returns a nonzero string ID if the call to it was successful. Snap-ins therefore can safely use 0 to indicate an unassigned ID.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IStringTable
IStringTable::DeleteString
IStringTable::DeleteAllStrings

 

 

Show: