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
Re: Converting GUID -> string -> GUID
GUID -> CString: ::StringFromGUID2()
CString -> GUID: No way?
Any exprienced guy(s)?
Re: Converting GUID -> string -> GUID
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#
Re: Converting GUID -> string -> GUID
Quote:
Originally Posted by
coshe
Sorry, but I have to report your post as spam. :cool:
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.
Re: Converting GUID -> string -> GUID
Quote:
Originally Posted by
brain123422
Didn't you read the post#5? :confused:
Then
Quote:
Originally Posted by
VictorN
Sorry, but I have to report your post as spam. :cool: