标题:如何加载dll,我有用的是m_hSTKDrv =AfxLoadLibrary( filePath )可是m_hSTK ...
取消只看楼主
张丹
Rank: 2
等 级:论坛游民
帖 子:94
专家分:66
注 册:2010-6-7
结帖率:42.86%
 问题点数:0 回复次数:0 
如何加载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,这是怎么回事呢
搜索更多相关主题的帖子: 加载 hSTKDrv filePath dll 
2010-06-10 11:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-309837-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097642 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved