Wanting2LearnMan
asked on
'UuidToStringW' and 'RpcStringFreeW' errors..
I'm trying to use CoCreateGuid to generate a GUID in my VC++ windows mobile project.
The following code:
GUID guid;
CoCreateGuid(&guid);
BYTE * str;
UuidToString((UUID*)&guid, &str);
CString unique((LPTSTR)str);
RpcStringFree(&str);
unique.Replace(_T("-"), _T("_"));
gives me the following errors:
error C2664: 'UuidToStringW' : cannot convert parameter 2 from 'BYTE **' to 'unsigned short **'
error C2664: 'RpcStringFreeW' : cannot convert parameter 1 from 'BYTE **' to 'unsigned short **'
how do i solve this?
The following code:
GUID guid;
CoCreateGuid(&guid);
BYTE * str;
UuidToString((UUID*)&guid,
CString unique((LPTSTR)str);
RpcStringFree(&str);
unique.Replace(_T("-"), _T("_"));
gives me the following errors:
error C2664: 'UuidToStringW' : cannot convert parameter 2 from 'BYTE **' to 'unsigned short **'
error C2664: 'RpcStringFreeW' : cannot convert parameter 1 from 'BYTE **' to 'unsigned short **'
how do i solve this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
error C2065: 'RPC_WSTR' : undeclared identifier
>>Try an explicit cast
same errors as original post
still looking into alexey_gusevs suggestion