Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateUniqueID (General Extensibility)
Cut
Run
Collapse the table of content
Expand the table of content

CreateUniqueID Method (General Extensibility)

Visual Studio .NET 2003

Creates a programmatic identifier that does not collide with other identifiers in the scope, and follows the current language naming rules.

[Visual Basic .NET]
Public Function CreateUniqueID( _
   ByVal Prefix As String, _
   Optional NewName As String = 0 _
) As Boolean
[Visual Basic 6]
Function CreateUniqueID( _
   ByVal Prefix As String, _
   Optional NewName As String = 0 _
) As Boolean
[C++]
HRESULT __stdcall CreateUniqueID(
   BSTR Prefix,
   BSTR* NewName,
   /* [out, retval] */ VARIANT_BOOL* retVal
);
[C#]
bool CreateUniqueID(
   string Prefix,
   ref string NewName
);
[JScript .NET]
public function CreateUniqueID(
   Prefix : String,
   NewName : String
) : Boolean

Parameters

Prefix
Required. The prefix string or whole name to check to see whether or not it is unique for the collection of code elements.
NewName
Optional. If supplied, this returns with a guaranteed unique name.

Return Value

True if the name is a unique identifier; False if it is not.

Remarks

Returns whether Prefix is a unique identifier in the collection of code elements. If the second argument, NewName, is supplied, then it returns a unique name based on Prefix as a prefix (possibly the same characters with no additional characters). The return value, however, always returns whether Prefix is unique, regardless of whether the second argument is supplied.

See Also

Applies To: CodeElements Collection | VCCodeElements Collection

Show:
© 2015 Microsoft