尝试在Platform :: String上的桌面应用程序中使用WinRT C ++ / CX时获取错误C2664 [英] Getting error C2664 when trying to use WinRT C++/CX in a desktop app on Platform::String

查看:65
本文介绍了尝试在Platform :: String上的桌面应用程序中使用WinRT C ++ / CX时获取错误C2664的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2015社区我收到此错误

 错误:C2664 :'long __winRT :: __ getActivationFactoryByPCWSTR(void *,Platform :: Guid&,void **)':无法将参数1从'const wchar_t [44]'转换为'void *' 



$

解决方案

你试过样品吗? :
https://code.msdn.microsoft.com/windowsapps/WiFiDirectDevice-sample-59a6e5e0
?它也会调用
GetDeviceSelector 。然后尝试添加头文件以检查它是否仍然有效。




Using Visual Studio 2015 Community I get this error

error: C2664: 'long __winRT::__getActivationFactoryByPCWSTR(void *,Platform::Guid &,void **)': cannot convert argument 1 from 'const wchar_t [44]' to 'void *'


解决方案

Have you tried the sample: https://code.msdn.microsoft.com/windowsapps/WiFiDirectDevice-sample-59a6e5e0? It calls GetDeviceSelector too. Then try adding the header files in order to check if it still works.



这篇关于尝试在Platform :: String上的桌面应用程序中使用WinRT C ++ / CX时获取错误C2664的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆