- 论坛徽章:
- 0
|
- void CDll3Dlg::OnButton1()
- {
- // TODO: Add your control notification handler code here
- double* DList = NULL;
- CString dList;
- typedef void (*MyCalculate)(double *);
- HINSTANCE hdll;
- MyCalculate calfunc;
- hdll = LoadLibrary("..\\debug\\Dll4.dll");
- if (hdll != NULL)
- {
- calfunc = (MyCalculate)GetProcAddress(hdll, "floatcalculate");
- }
- else
- {
- AfxMessageBox("无法加载DLL");
- return;
- }
- UpdateData(true);
- calfunc(DList);
- dList.Format("%f", *DList);
- for (int i = 0; i < 20; i++)
- {
- Sleep(300);
- int nRow = m_CtrList.InsertItem(0, dList);
- }
- }
复制代码 麻烦大家帮我看一下,为啥运行到21行就会出错,我这是加载了一个dll在里面,刚接触学习dll,希望大家帮忙 |
|