C ++错误C 2664无法将参数从“IID *”转换为“const IID&”

时间:2018-03-09 02:54:46

标签: c++ visual-c++

我的代码:

IID              xIID_ICMLuaUtil;

if (IIDFromString(T_IID_ICMLuaUtil, &xIID_ICMLuaUtil) != S_OK) {
        break;
}

r = ucmMasqueradedCoGetObjectElevate(
        T_CLSID_CMSTPLUA,
        CLSCTX_LOCAL_SERVER,
        &xIID_ICMLuaUtil,
        NULL);

ucmMasqueradedCoGetObjectElevate函数:

HRESULT ucmMasqueradedCoGetObjectElevate(
_In_ LPWSTR clsid,
_In_ DWORD dwClassContext,
_In_ REFIID riid,
_Outptr_ void **ppv);

REFIID:

#define REFIID const IID * __MIDL_CONST 
IN c:\Program Files (x86)\Windows Kits\8.1\Include\shared\guiddef.h line 119

错误:

错误C2664“HRESULT ucmMasqueradedCoGetObjectElevate(LPWSTR,DWORD,const IID&,void **)”:无法将参数3从“IID *”转换为“const IID&” test2 c:\ users \ son \ desktop \ 60 \ test2 \ Api.c 62

我第一次使用stackoverflow,抱歉我的不完整!

1 个答案:

答案 0 :(得分:1)

HTMLElement的通话中从&移除&xIID_ICMLuaUtil运算符。

如错误消息所示,该参数是对ucmMasqueradedCoGetObjectElevate(不是REFIID)的引用。