国产毛片a精品毛-国产毛片黄片-国产毛片久久国产-国产毛片久久精品-青娱乐极品在线-青娱乐精品

電子工程網(wǎng)

標題: LabWindows/CVI調(diào)用DLL實用例程(菜農(nóng)HotPower) [打印本頁]

作者: hotpower    時間: 2009-4-2 23:57
標題: LabWindows/CVI調(diào)用DLL實用例程(菜農(nóng)HotPower)
/*-------------------------------------------------------------------------------------------------------*/
/*    LabWindows/CVI調(diào)用DLL實用例程(菜農(nóng)HotPower)                                              */
/*  本例程是在CVI自帶的simple添加調(diào)用mydll.dll的函數(shù)MyDLLCdeclFunction()                                 */
/*  網(wǎng)上和CVI的例程很少,一般為調(diào)用LIB實例,但很多dll都是以*.dll提供的,故本例程很實用。                    */
/*  本例程主要是調(diào)用了三個Windows API函數(shù)LoadLibrary(),GetProcAddress(),FreeLibrary()                    */
/*  菜農(nóng)HotPower@126.com  2008.5.27  于西安大雁塔菜地                                                    */
/*-------------------------------------------------------------------------------------------------------*/
/* This is a simple project that will call
* functions from an external DLL */
//#define  __cplusplus
#include
#include //需要的API函數(shù)實際在winbase.h中定義
#include     /* Needed if linking in external compiler; harmless otherwise */
#include
#include
#include "mydll.h"
/*-------------------------------------------------------------------------------------------------------*/
typedef long int DLLEXPORT (*DLLCdeclFunction)(char *);//定義函數(shù)指針
/*-------------------------------------------------------------------------------------------------------*/
int status;
char message[80];
int main (int argc, char *argv[])
{
/*-------------------------------------------------------------------------------------------------------*/
    HMODULE hinstLib;
    DLLCdeclFunction DLLFunction;
    BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
/*-------------------------------------------------------------------------------------------------------*/
    if (InitCVIRTE (0, argv, 0) == 0)    /* Needed if linking in external compiler; harmless otherwise */
        return -1;    /* out of memory */
    /* Tell the dll to run it's user interface */
    RunDllUI();

/*-------------------------------------------------------------------------------------------------------*/
   // Get a handle to the DLL module.
    hinstLib = LoadLibrary("mydll.dll");//裝載動態(tài)鏈接庫mydll.dll
   // If the handle is valid, try to get the function address.
    if (hinstLib != NULL)//成功裝載動態(tài)鏈接庫mydll.dll  
    {
       DLLFunction = (DLLCdeclFunction)GetProcAddress(hinstLib, (LPCSTR)"MyDLLCdeclFunction");//取函數(shù)指針地址
             // If the function address is valid, call the function.
       if (fRunTimeLinkSuccess = (DLLFunction != NULL))//dll中有函數(shù)MyDLLCdeclFunction()
    {
            Fmt(message, "message via DLL function\n");
            status = (long int)DLLFunction (message);//調(diào)用dll函數(shù)!!!
    }
             // Free the DLL module
       fFreeResult = FreeLibrary(hinstLib);//卸載動態(tài)鏈接庫mydll.dll
    }
    // If unable to call the DLL function, use an alternative
    if (! fRunTimeLinkSuccess)
{
       Fmt(message, "message via alternative method\n");
    MessagePopup ("CVI MessagePopup ", message);     
}
/*-------------------------------------------------------------------------------------------------------*/
點擊下載工程源碼: cvidlldemo.rar

作者: cyber211    時間: 2009-6-28 23:10
還在用LabWindows/CVI啊,換Labview,不用編代碼了
作者: f.luo    時間: 2010-5-25 22:20
頂一下




歡迎光臨 電子工程網(wǎng) (http://m.qingdxww.cn/) Powered by Discuz! X3.4
主站蜘蛛池模板: 国产原创麻豆精品视频 | 久久香蕉国产线看观看网站 | 久久久久久久久久久久久久久久久 | 操穴网站 | 国产午夜精品不卡观看 | 国产精品高清视亚洲一区二区 | 美国伦理片大全手机在线 | 国产极品喷水视频 | 欧美无遮挡 | 丁香色婷婷国产精品视频 | 亚洲免费一级视频 | 香蕉视频亚洲一级 | 国产精品lululu在线观看 | 午夜一级毛片看看 | 国产馆在线观看免费的 | 久久99国产精品视频 | 免费国产小视频在线观看 | 99色图| 婷婷亚洲五月 | 国产精品成人久久久久久久 | 日本卡通动漫影院网站 | 女人18毛片视频一级毛片容 | 91免费精品视频 | 亚洲综合免费视频 | 亚洲成人黄色在线观看 | 亚洲国产日韩欧美在线 | 四虎在线最新永久免费播放 | 狠狠色婷婷丁香综合久久韩国 | 免费大片av手机看片 | 精品福利网 | 99久久国产综合精品麻豆 | 欧美黑人成人www在线观看 | 久久经典视频 | 日本一区二区网站 | 欧美大片在线观看完整版 | 99re视频在线 | 67194最新网址 | 亚洲永久精品一区二区三区 | 久久毛片免费看一区二区三区 | 天天色综合三 | 中文字幕日韩在线一区国内 |