【发布时间】:2013-06-06 09:00:50
【问题描述】:
我在微软的“WIA 教程”页面看到了这种编码方式,但是 vc++ 不允许我编译它!总是出现一些错误!
#include "stdafx.h"
#include <Strsafe.h>
#include <Wia.h>
#include <WinError.h>
bool CreateWiaDeviceManager( IWiaDevMgr2 **ppWiaDevMgr ){
//
// Validate arguments
//
if (NULL == ppWiaDevMgr)
{
return E_INVALIDARG;
}
//
// Initialize out variables
//
*ppWiaDevMgr = NULL;
//
// Create an instance of the device manager
//
//Vista or later:
HRESULT hr = CoCreateInstance( CLSID_WiaDevMgr2, NULL, CLSCTX_LOCAL_SERVER, IID_IWiaDevMgr2, (void**)ppWiaDevMgr );
//
// Return the result of creating the device manager
//
return SUCCEEDED(hr);
}
有错误:
1>WIAScanner.cpp(11):错误 C2065:“IWiaDevMgr2”:未声明的标识符 1>WIAScanner.cpp(11): 错误 C2065: 'ppWiaDevMgr' : 未声明的标识符 1>WIAScanner.cpp(11): error C2448: 'CreateWiaDeviceManager' : function-style initializer 似乎是一个函数定义
感谢您的关注。
【问题讨论】:
标签: c++ visual-c++ wia