YC Yc.W home Systems · C++ · AI Infrastructure
C & C++ · Note

C++-CLSID

Explore all C & C++ notes →

July 9, 2020 9:08 PM

OPC中Server的CLSID转换。

转换用宏: USES_CONVERSION;

##StringFromCLSID CString temp; LPOLESTR lpszOleUuidstr1 = NULL; StringFromCLSID(clsid,&lpszOleUuidstr1); LPTSTR lpszUuidstr1 = OLE2T(lpszOleUuidstr1); temp.Format(_T(“%s”),lpszUuidstr1); CoTaskMemFree(lpszOleUuidstr1);

##CLSIDFromString LPTSTR tempL = “{C14D1400-D13A-11D2-93B9-0060B067C684}”; LPOLESTR tempLp = T2OLE(tempL); CLSIDFromString((LPOLESTR)tempLp, (LPCLSID)&clsid);

参考:Microsoft Learn:StringFromCLSID。


AI 修改声明: 本文由 LLM 协助校对,最近修改时间:2026-09-25 02:41(UTC+08:00)。


← Previous Windows API-_com_error

Next → Java-JNA