Click to See Complete Forum and Search --> : Converting GUID -> string -> GUID
Marqy
May 24th, 1999, 06:32 AM
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
myron
December 6th, 2004, 12:59 AM
GUID -> CString: ::StringFromGUID2()
CString -> GUID: No way?
Any exprienced guy(s)?
Ajay Vijay
December 6th, 2004, 09:58 AM
CLSIDFromString (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_a2c_3b3b.asp)
coshe
July 12th, 2010, 06:34 AM
Sample with guid->string string ->guid and Guid::NewGuid() that we like in .net
http://www.codequests.com/project.aspx?projectId=Win32Guid#
VictorN
July 12th, 2010, 06:37 AM
Sample with guid->string string ->guid and Guid::NewGuid() that we like in .net
http://www.codequests.com/project.aspx?projectId=Win32Guid#Sorry, but I have to report your post as spam. :cool:
coshe
July 17th, 2010, 12:43 PM
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.
VictorN
July 19th, 2011, 08:42 AM
... You can use the below Online tools to convert string to GUID and and vice versa
http://www.windowstricks.in/2011/05/string-to-guid-converter.html
Didn't you read the post#5? :confused:
Then
Sorry, but I have to report your post as spam. :cool:
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.