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

查看: 7817|回復: 2
打印 上一主題 下一主題

LabWindows/CVI調用DLL實用例程(菜農HotPower)

[復制鏈接]
跳轉到指定樓層
樓主
發表于 2009-4-2 23:57:48 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
關鍵詞: CVI , HotPower , LabWindows , 菜農 , 例程
/*-------------------------------------------------------------------------------------------------------*/
/*    LabWindows/CVI調用DLL實用例程(菜農HotPower)                                              */
/*  本例程是在CVI自帶的simple添加調用mydll.dll的函數MyDLLCdeclFunction()                                 */
/*  網上和CVI的例程很少,一般為調用LIB實例,但很多dll都是以*.dll提供的,故本例程很實用。                    */
/*  本例程主要是調用了三個Windows API函數LoadLibrary(),GetProcAddress(),FreeLibrary()                    */
/*  菜農HotPower@126.com  2008.5.27  于西安大雁塔菜地                                                    */
/*-------------------------------------------------------------------------------------------------------*/
/* This is a simple project that will call
* functions from an external DLL */
//#define  __cplusplus
#include
#include //需要的API函數實際在winbase.h中定義
#include     /* Needed if linking in external compiler; harmless otherwise */
#include
#include
#include "mydll.h"
/*-------------------------------------------------------------------------------------------------------*/
typedef long int DLLEXPORT (*DLLCdeclFunction)(char *);//定義函數指針
/*-------------------------------------------------------------------------------------------------------*/
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");//裝載動態鏈接庫mydll.dll
   // If the handle is valid, try to get the function address.
    if (hinstLib != NULL)//成功裝載動態鏈接庫mydll.dll  
    {
       DLLFunction = (DLLCdeclFunction)GetProcAddress(hinstLib, (LPCSTR)"MyDLLCdeclFunction");//取函數指針地址
             // If the function address is valid, call the function.
       if (fRunTimeLinkSuccess = (DLLFunction != NULL))//dll中有函數MyDLLCdeclFunction()
    {
            Fmt(message, "message via DLL function\n");
            status = (long int)DLLFunction (message);//調用dll函數!!!
    }
             // Free the DLL module
       fFreeResult = FreeLibrary(hinstLib);//卸載動態鏈接庫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
沙發
發表于 2009-6-28 23:10:50 | 只看該作者
還在用LabWindows/CVI啊,換Labview,不用編代碼了
板凳
發表于 2010-5-25 22:20:52 | 只看該作者
頂一下
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯系我們
電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
快速回復 返回頂部 返回列表
主站蜘蛛池模板: 亚洲欧美日韩中文字幕网址 | 久久久噜噜噜久久老司机 | 欧美tv| 国产拍自 | 麻豆视频免费在线 | 免费看美女部位隐私 | 女老师免费观看 | 丝瓜小猪草莓芭乐榴莲幸福宝 | 国产第一页福利 | 国产精品亚洲一区二区麻豆 | 日韩黄网站 | 99re6在线播放 | 日本中文字幕免费 | 欧美成人精品一区二三区在线观看 | 日韩在线第一区 | 成年女人毛片免费观看97 | 国产精品手机网站 | 最新地址四虎www4hutv | 国产成人永久免费视频 | 亚洲三级在线观看 | 亚洲精品中文字幕午夜 | 手机在线精品视频 | 成人午夜精品网站在线观看 | 欧美日韩一区二区三区色综合 | 久久精品国产国语对白 | 欧美日韩一级视频 | 99热精品在线观看 | 久久夜视频 | 亚洲欧美日韩成人一区在线 | 国产一区二区三区久久精品 | 岛国精品在线观看 | 一区精品麻豆经典 | 亚洲精品高清久久 | 天天干天操| 免费特黄级夫费生活片 | 一级做a爱片特黄在线观看免费看 | 国产精品久久国产三级国不卡顿 | 欧插网| 国产一级精品高清一级毛片 | 好吊788gaoco| a高清免费毛片久久 |