: 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("开始成功");
}
5 个解决方案
#1
"SmartHopper.dll 里面是不是没有StartCoinRecognition方法啊?或者说不叫这个名字,你用dependence 看看
#2
可能是你的dll使用问题,像1L说的方法名称不对,或者是你的dll版本问题
#3
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处。
#4
可能是引入dll时有问题,换成隐式调用试试
#5
同求 累死问题
#1
"SmartHopper.dll 里面是不是没有StartCoinRecognition方法啊?或者说不叫这个名字,你用dependence 看看
#2
可能是你的dll使用问题,像1L说的方法名称不对,或者是你的dll版本问题
#3
崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处。
#4
可能是引入dll时有问题,换成隐式调用试试
#5
同求 累死问题