色偷偷偷久久伊人大杳蕉,色爽交视频免费观看,欧美扒开腿做爽爽爽a片,欧美孕交alscan巨交xxx,日日碰狠狠躁久久躁蜜桃

x
x
查看: 7858|回復(fù): 2
打印 上一主題 下一主題

LabWindows/CVI調(diào)用DLL實(shí)用例程(菜農(nóng)HotPower)

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2009-4-2 23:57:48 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
關(guān)鍵詞: CVI , HotPower , LabWindows , 菜農(nóng) , 例程
/*-------------------------------------------------------------------------------------------------------*/
/*    LabWindows/CVI調(diào)用DLL實(shí)用例程(菜農(nóng)HotPower)                                              */
/*  本例程是在CVI自帶的simple添加調(diào)用mydll.dll的函數(shù)MyDLLCdeclFunction()                                 */
/*  網(wǎng)上和CVI的例程很少,一般為調(diào)用LIB實(shí)例,但很多dll都是以*.dll提供的,故本例程很實(shí)用。                    */
/*  本例程主要是調(diào)用了三個(gè)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ù)實(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");//裝載動(dòng)態(tài)鏈接庫(kù)mydll.dll
   // If the handle is valid, try to get the function address.
    if (hinstLib != NULL)//成功裝載動(dòng)態(tài)鏈接庫(kù)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);//卸載動(dòng)態(tài)鏈接庫(kù)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);     
}
/*-------------------------------------------------------------------------------------------------------*/
點(diǎn)擊下載工程源碼: cvidlldemo.rar
沙發(fā)
發(fā)表于 2009-6-28 23:10:50 | 只看該作者
還在用LabWindows/CVI啊,換Labview,不用編代碼了
板凳
發(fā)表于 2010-5-25 22:20:52 | 只看該作者
頂一下

本版積分規(guī)則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權(quán)所有   京ICP備16069177號(hào) | 京公網(wǎng)安備11010502021702
快速回復(fù) 返回頂部 返回列表