在midl中使用Windows :: Foundation命名空间接口

时间:2017-10-23 07:33:54

标签: c++ windows midl wrl

我想在我的midl文件中使用Windows :: Foundation中定义的接口。 为此,我编写了以下示例代码,但它给出了编译错误: 错误MIDL2011未解析的类型声明:IStringable [过程'MyCustomMethod2'的参数'param2'(接口'mytestmidl.MyTestInterface')] mytestmidl.idl 12

如何从midl文件中引用IStringable或其他接口?

#include <sdkddkver.h>
import "Windows.Foundation.idl";
//using namespace Windows::Foundation;

namespace mytestmidl
{ 
   [version(1.0), uuid(332FD2F1-1C69-4C91-949E-4BB67A85BE00)] 
   interface MyTestInterface : IInspectable
   {
       HRESULT MyCustomMethod1([in] HSTRING param1);
       HRESULT MyCustomMethod2([in] IStringable *param2);
   }
}

1 个答案:

答案 0 :(得分:0)

我认为你应该在它之前添加一个命名空间名称:

first_user.php