0xC0000005: 读取位置 0x00000000 时发生访问冲突
蓝水海域 2012-10-22 11:12:29 CSmartHopperTestToolDlg::CSmartHopperTestToolDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CSmartHopperTestToolDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
HINSTANCE hinstDLL = LoadLibrary("SmartHopper.dll");
m_Init = (tInit)GetProcAddress(hinstDLL,"Init");
m_Start = (tStart)GetProcAddress(hinstDLL,"Start");
m_Reset = (tReset)GetProcAddress(hinstDLL,"Reset");
m_Exit = (tExit)GetProcAddress(hinstDLL,"Exit");
m_Enable = (tEnable)GetProcAddress(hinstDLL,"Enable");
m_Disable = (tDisable)GetProcAddress(hinstDLL,"Disable");
m_Poll = (tPoll)GetProcAddress(hinstDLL,"Poll");
m_SetRouting = (tSetRouting)GetProcAddress(hinstDLL,"SetRouting");
m_GetRouting = (tGetRouting)GetProcAddress(hinstDLL,"GetRouting");
m_SetCoinAmount = (tSetCoinAmount)GetProcAddress(hinstDLL,"SetCoinAmount");
m_GetCoinAmount = (tGetCoinAmount)GetProcAddress(hinstDLL,"GetCoinAmount");
m_PayoutAmount = (tPayoutAmount)GetProcAddress(hinstDLL,"PayoutAmount");
m_FloatByDenomination = (tFloatByDenomination)GetProcAddress(hinstDLL,"FloatByDenomination");
m_EmptyCoin = (tEmptyCoin)GetProcAddress(hinstDLL,"EmptyCoin");
m_CashBoxPayoutOperationData = (tCashBoxPayoutOperationData)GetProcAddress(hinstDLL,"CashBoxPayoutOperationData");
//硬币识别
m_StartCoinRecognition=(tStartCoinRecognition)GetProcAddress(hinstDLL,"StartCoinRecognition");
m_CloseCoinRecognition=(tCloseCoinRecognition)GetProcAddress(hinstDLL,"CloseCoinRecognition");
m_CoinRecognition=(tCoinRecogniton)GetProcAddress(hinstDLL,"CoinRecognition");
}
/*硬币识别模块从动态库引用函数,初始化m_StartCoinRecognition的值为0x000000000????为什么会这样呢?*/[——————————
//开始硬币的识别
void CSmartHopperTestToolDlg::OnBnClickedButton15()
{
// TODO: 在此添加控件通知处理程序代码
int ret=m_CloseCoinRecognition(100);
if(ret!=0xF0) MessageBox("开启识别一元失败");
ret=m_CloseCoinRecognition(50);
if(ret!=0xF0) MessageBox("开启识别五角失败");
ret=m_CloseCoinRecognition(10);
if(ret!=0xF0) MessageBox("开启识别一角失败");
MessageBox("开始成功");
}