📄 sample10dde.c
字号:
//此程序为主程序,主要是应用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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -