如何加载dll,我有用的是m_hSTKDrv =AfxLoadLibrary( filePath )可是m_hSTKDrv 是0
m_hSTKDrv = AfxLoadLibrary( filePath );if( !m_hSTKDrv )
return;
m_pfnStock_Init = \
(int (WINAPI *)(HWND,UINT,int)) GetProcAddress(m_hSTKDrv,"Stock_Init");
m_pfnStock_Quit = \
(int (WINAPI *)(HWND)) GetProcAddress(m_hSTKDrv,"Stock_Quit");
m_pfnGetTotalNumber = \
(int (WINAPI *)())GetProcAddress(m_hSTKDrv,"GetTotalNumber");
m_pfnSetupReceiver = \
(int (WINAPI *)(BOOL))GetProcAddress(m_hSTKDrv,"SetupReceiver");
m_pfnGetStockDrvInfo = \
(DWORD (WINAPI *)(int,void * ))GetProcAddress(m_hSTKDrv,"GetStockDrvInfo");
m_pfnGetStockByNoEx=\
(int (WINAPI *)(int,RCV_HANGQING_STRUCTEx *))GetProcAddress(m_hSTKDrv,"GetStockByNoEx");
m_pfnGetStockByCodeEx=\
(int (WINAPI *)(char *,int,RCV_HANGQING_STRUCTEx *))GetProcAddress(m_hSTKDrv,"GetStockByCodeEx");
m_hSTKDrv=0,直接就返回了。
或者我写成 m_hSTKDrv = AfxLoadLibrary( "C:\\sc\\SCStock.dll" );了之后m_hSTKDrv有值,但是m_pfnGetStockByCodeEx,m_pfnGetStockByNoEx,m_pfnGetStockDrvInfo ,m_pfnSetupReceiver,m_pfnGetTotalNumber都为0,这是怎么回事呢