2
回答
atlbase.h(5853) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID' to 'const void *'
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

//IsEqualGUID 定义在winddi.h中

#ifndef IsEqualGUID
    #define IsEqualGUID(guid1, guid2) \
        (!memcmp((guid1), (guid2), sizeof(GUID)))
#endif // !defined(IsEqualGUID)

 

//ATLINLINE ATLAPI AtlModuleRegisterServer定义在atlbase.h中

ATLINLINE ATLAPI AtlModuleRegisterServer(_ATL_MODULE* pM, BOOL bRegTypeLib, const CLSID* pCLSID)

{

....

if (!IsEqualGUID(*pCLSID, *pEntry->pclsid))   //报错-注释1

    continue;

}

问题:如何做到'const struct _GUID' 转 'const void *'?或是我的头文件包含的顺序错了?

          Help me!Thanks!

注释1:vc98\atl\include\atlbase.h(5853) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID' to 'const void *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

ATL
举报
tang
发帖于6年前 2回/962阅
顶部