- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在关注来自 msdn https://msdn.microsoft.com/en-us/library/ms629848(v=vs.85).aspx 的示例:
HRESULT CreateWiaDeviceManager(IWiaDevMgr2 **ppWiaDevMgr)
{
CoInitialize(NULL);
// Validate arguments
if (NULL == ppWiaDevMgr)
return E_INVALIDARG;
// Initialize out variables
*ppWiaDevMgr = NULL;
// Create an instance of the device manager
HRESULT hr = CoCreateInstance( CLSID_WiaDevMgr2, NULL, CLSCTX_LOCAL_SERVER, IID_IWiaDevMgr2, (void**)ppWiaDevMgr );
// Return the result of creating the device manager
return hr;
}
但是在编译时我得到了这个错误:
错误 389 error C2440: 'type cast' : cannot convert from 'const CLSID' to 'const IID *const '
错误 392 error C2440: 'type cast' : cannot convert from 'const IID' to 'const IID *const '
关于CoCreateInstance的参数。
我没有对示例代码进行任何有意义的更改...任何人都可以建议我为什么得到这个吗?
最佳答案
尝试HRESULT hr = CoCreateInstance( &CLSID_WiaDevMgr2, NULL, &CLSCTX_LOCAL_SERVER, &IID_IWiaDevMgr2, (void**)ppWiaDevMgr );
在 C++ 中,代码构建为发布在 MSVC2013 上,包括:
#include <guiddef.h>
#include <afxwin.h>
#include <Wia.h>
#include <tchar.h>
关于创建 WIA 设备管理器会出现编译时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37378741/
我无法获得允许用户授予应用程序成为设备管理员工作权限的 Activity 。 我的代码如下... ComponentName comp = new ComponentName(this, Custom
您好,我对 Azure AD 中的设备管理有疑问。 假设我有两个组:组 1 和组 2。组 1 已分配成员资格,组 2 已分配动态设备成员资格。 组 1 的所有者是用户 1,即云设备管理员,组 2 的所
我想为使用 android device administration API 的应用程序编写测试.我的问题是用户需要手动授予应用程序一次性批准才能拥有管理员权限,否则将在运行时抛出 Security
我是 Windows Phone 开发的新手。有人可以帮我解决以下有关 Windows Phone 8 的问题吗? 公司中心:我假设这将是一个自定义应用程序,用作其他公司应用程序(以及其他公司信息)的
我是 AWS 的新手,正在探索针对 Android 和 iOS 平台的移动应用程序。我的应用程序的一个要求是提供推送通知,其中用户订阅特定主题,然后获取这些主题的通知.我已经浏览过 Amazon SN
我正在尝试制作一个禁用相机的应用程序,我正在尝试 SDK 中的 Device Admin 示例,它在模拟器上运行良好但在设备上,应用程序强制关闭项目点击并显示 NoSuchmethod 错误。 代码
我是一名优秀的程序员,十分优秀!