如何使用nsCOMPtr正确调用do_QueryInterface
How to properly call do_QueryInterface with nsCOMPtr
我正在使用Gecko SDK 32.0.2 for win32。我有一段代码,应该可以工作:
nsCOMPtr<nsIDOMDocument> doc;
dwi->GetDocument(getter_AddRefs(doc));
nsCOMPtr<nsIDOMDocumentXBL> xbl(do_QueryInterface(doc));
但是,编译器说:
no instance of overloaded function 'do_QueryInterface' matches argument list nsCOMPtr<nsIDOMDocument>
可用的过载有:
do_QueryInterface(nsISupports* rawPointer)
和
do_QueryInterface(already_AddRefed<T>&)
在这种情况下,如何正确地进行函数调用?
我会自己回答。。。正如我在评论中所写的,我没有得到任何回答,但我找到了原因。它与消息没有直接关系,这是由于VSC++项目属性造成的:将WChar_t视为内置类型应设置为"是(/Zc:WChar_t)"
相关文章:
- 为什么"do while"循环不断退出,即使条件计算结果为 false?
- 如果条件为TRUE(最佳方式?),则在do while循环中后置增量
- 即使没有满足他们的条件,我也无法通过一些 do-while 循环
- 如何使用 do while 循环确定最高值和最低值
- do while 循环中的 if 语句以 yes 或 no 结尾
- 以某种方式告诉编译器"Do not process line of code"
- 在 C 或 C++ 中,循环可以同时具有 "do" 和"while"部分吗?
- 使用 while 或 do while 退出循环
- 带有开关语句的 do-while 循环 -- 无穷循环错误
- 为什么当我输入一个被接受的数字时,我的 do-while 循环没有中断?
- 为什么我的 Do-while 循环无法在C++中运行菜单
- 如果语句不会在 do - while 循环中运行
- 开放CV垫"Sizes of input arguments do not match"的问题
- 为什么当我对数组使用增量操作时,do for 循环不起作用
- 如何在c++中读取do-while循环中的空白
- 什么是'do while loop'的真实应用?
- 将嵌套的 for 循环更改为 do-while 循环
- 如何修复不会在退出选择时终止的 do-while 循环
- 带有do函数的无限循环
- 为什么这个do-while循环每隔一个循环只写入数组?