-
May 24th, 1999, 06:32 AM
#1
Converting GUID -> string -> GUID
An app I'm writing needs to associate archived data (using Access) with some unique identifier & I'm think about using GUID's. As far as I can see, I can create using ::CoCreateGUID()
and convert it to a string using ::StringFromGUID2()
However, there doesn't seem to be an API call going in the other direction for GUIDs (I've found CLSIDFromString & IIDFromString but no GUIDFromString). Anyone know how to go from String -> GUID?
MJA
-
December 6th, 2004, 01:59 AM
#2
Re: Converting GUID -> string -> GUID
GUID -> CString: ::StringFromGUID2()
CString -> GUID: No way?
Any exprienced guy(s)?
-
December 6th, 2004, 10:58 AM
#3
Re: Converting GUID -> string -> GUID
-
July 12th, 2010, 06:34 AM
#4
Re: Converting GUID -> string -> GUID
Sample with guid->string string ->guid and Guid::NewGuid() that we like in .net
http://www.codequests.com/project.as...tId=Win32Guid#
-
July 12th, 2010, 06:37 AM
#5
-
July 17th, 2010, 12:43 PM
#6
Re: Converting GUID -> string -> GUID
Sorry, I'm new. Didn't know that you can't link to non code-guru site.
Here is the code to parse .net style Guid.ToString() output as win32 Guid.
static bool TryParse( const WCHAR* wzGuid, _Out_ UUID& guid )
{
UUID rawGuid;
wstring parenGuid( L"{" );
parenGuid += wzGuid;
parenGuid += L"}" ;
HRESULT hr = CLSIDFromString( parenGuid.c_str(), &rawGuid );
if( FAILED( hr ) )
{
return false;
}
guid = rawGuid;
return true;
}
Please remove my previous post then. Thanks.
-
July 19th, 2011, 08:42 AM
#7
Re: Converting GUID -> string -> GUID
Originally Posted by brain123422
Didn't you read the post#5?
Then
Originally Posted by VictorN
Sorry, but I have to report your post as spam.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|