| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1245 人关注过本帖
标题:如何加载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
快速回复:如何加载dll,我有用的是m_hSTKDrv =AfxLoadLibrary( filePath )可是m ...
数据加载中...
 
   



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

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