警告MIDL2456:SAFEARRAY(接口指针)... [英] warning MIDL2456 : SAFEARRAY(interface pointer)...
本文介绍了警告MIDL2456:SAFEARRAY(接口指针)...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我第一次尝试使用SAFEARRAY.
我在IDL中有以下方法声明:
This is the first time I am trying to use SAFEARRAYs.
I have the following method declaration in IDL:
//.IMyObj2
[
object,
uuid(3454B81A-65A9-4F3E-8678-1D5F82B25837),
oleautomation,
nonextensible,
helpstring("IMyObj2 Interface"),
pointer_default(unique)
]
interface IMyObj2 : IDispatch{
};
//.IArrayMan3
[
object,
uuid(EF532C8B-12A9-4FEC-B91C-D7502FD68874),
oleautomation,
nonextensible,
helpstring("IArrayMan3 Interface"),
pointer_default(unique)
]
interface IArrayMan3 : IUnknown{
[helpstring("method GetArray")]
HRESULT _stdcall GetArray2(SAFEARRAY(IMyObj2*)* pArray);
[helpstring("method PutArray")]
HRESULT _stdcall PutArray2(SAFEARRAY(IMyObj2*) pArray);
};
我收到以下警告:
I get the following warning:
warning MIDL2456 : SAFEARRAY(interface pointer) doesn't work using midl generated proxy : [ Parameter 'pArray' of Procedure 'PutArray2' ( Interface 'IArrayMan3' ) ]
在此先感谢您.
Thanks in advance.
推荐答案
您是否已将其声明为库?如果是这样,则可以使用OleView实用程序检查.tlb文件中的输出.
仅当此接口没有库封装时,我才会收到此警告.
避免此警告消息的另一种方法可能是使用以下技巧:
Have you declared it as a library? If so, you can use OleView utility to check output in your .tlb file.
I receive this warning only if there is no library incapsulation for this interfaces.
The other way to avoid this warning message might be using the following trick:
struct SMyObj{
IMyObj2 * iobject;
};
interface IArrayMan3 : IUnknown{
[helpstring("method GetArray")]
HRESULT _stdcall GetArray2(SAFEARRAY(struct SMyObj*)* pArray);
[helpstring("method PutArray")]
HRESULT _stdcall PutArray2(SAFEARRAY(struct SMyObj*) pArray);
};
这篇关于警告MIDL2456:SAFEARRAY(接口指针)...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文