一直試著利用 

CoCreateGuid() 及 UuidToString()

取得GUID做為檔名


unsigned char * strguid=NULL;
UUID guid;

if(S_OK == CoCreateGuid(&guid))
{
if(RPC_S_OK == (UuidToString(&guid, &strguid)))
{
....
}
}

 

卻一直卡在 


'UuidToStringW' : cannot convert parameter 2 from 'unsigned char **' to 'RPC_WSTR *'  Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

這樣的訊息~~

結果只要去更改Project Properties把Character Set

從Use Unicode Character Set” 改為“Use Multi-Byte Character Set 就解了 

搞了一下午,結果現在在加班....殘念 = =

 

關於這個吊詭的錯誤訊息可以參考這篇文章 Error while compiling (C2664)

arrow
arrow
    全站熱搜

    以我為中心的宇宙 發表在 痞客邦 留言(0) 人氣()