sample10dde.c

来自「labwindows 源码 CVI的 DDE数据交换源代码 这是CVI和VB2」· C语言 代码 · 共 44 行

C
44
字号
//此程序为主程序,主要是应用DDE库,连接VB和Labwindows/CVI

#include <cvirte.h>    /* Needed if linking in external compiler; harmless otherwise */
#include <userint.h>    /* InstallMainCallback(), RunUserInterface() */
#include <stdio.h>      /* NULL */
#include "sample10svr.h"     /* TRUE, FALSE, ActivateServer(), ActivateClient(),
                           DeactivateServer(), DeactivateClient(),
                           ProcessServerIdleEvent(), ProcessClientIdleEvent() */


int CVICALLBACK MainCallback (int panelOrMenuBar, int controlOrMenuItem, int event,
        void *callbackData, int eventData1, int eventData2);


//主函数
int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)    /* Needed if linking in external compiler; harmless otherwise */
        return -1;    /* out of memory */
    
    InstallMainCallback (MainCallback, NULL, TRUE);
    SetIdleEventRate (200);
    ActivateServer();
    RunUserInterface();     /* the server will eventually terminate this call */
    DeactivateServer();

    return 0;
}



int CVICALLBACK MainCallback (int panelOrMenuBar, int controlOrMenuItem, int event,
    void *callbackData, int eventData1, int eventData2)
{
    if (event == EVENT_IDLE) {
       // ProcessServerIdleEvent();
#if 0    /* formerly excluded lines */
        ProcessClientIdleEvent();
#endif   /* formerly excluded lines */
        }

    return FALSE;           /* FALSE --> event should not be swallowed */
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?