cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 4507|回复: 4

在CVI调用EXE文件

[复制链接]
发表于 2007-11-14 17:39:16 | 显示全部楼层 |阅读模式
怎样实现在cvi程序中来调用exe文件。
发表于 2007-11-14 23:01:08 | 显示全部楼层
好像CVI里面有一个EXE的,您搜索一下!好运!您搜索CVI的库函数里面的EXE就可以搜索到!
 楼主| 发表于 2007-11-15 08:06:22 | 显示全部楼层
多谢cpubbs,我去找找。
发表于 2007-11-28 11:44:53 | 显示全部楼层
用int LaunchExecutableEx (char *fileName, int windowState, int *handle)即可调用执行
发表于 2007-12-12 13:34:34 | 显示全部楼层

关于调用外部EXE文件的一点见解

这也是一个调用外部EXE文件的指令,他是ANSI C的程序,很老的.他system ()与LaunchExecutableEx()不同在前一个程序的运行不影响调用程序的运行,而后一个需要调用程序等待被调用程序执行完后,再继续.

---------------------------------------------------------

Starts running a program and waits for it to exit.  
If you do not want to wait for the program to exit,
use the LaunchExecutable() function in the Utility Library.

The executable can be either an MS DOS or MS Windows executable, including *.exe, *.com, *.bat and *.pif
files.  The function does not return until the command
terminates, and user keyboard and mouse events are ignored
until the command exits.  Callbacks for asynchronous events,
such as idle events, Windows messages, and VXI interrupts, PostDeferred calls, and DAQ events are called while the command is executing.  

If you need to execute a command built into command.com such as
copy, dir, etc, you can call LaunchExectuable() with the command:                     

   "command.com /C DosCommand args",

where DosCommand is the shell command you want to be executed.
Refer to your DOS documentation for further help with command.com.

.exe, .com, and .bat DOS programs use the settings in _default.pif (in your Windows directory) when running. You can
change their priority, display options, etc by editing
_default.pif or by creating another pif file.  Refer to your
Microsoft Windows documentation for help on creating and editing  pif files.

/*-------------------- Prototype ---------------------*/
int system (const char Command[]);
----------------------------------------------------------------------

Performs the same operation as LaunchExecutable with the following extended features:

Under Windows, you can specify how the Windows application displays.

LaunchExecutableEx returns a handle to the executable that can show whether the executable is still running and also can terminate the executable.

Note   If you want to wait for the program to exit, use the system function in the ANSI C Library.

When you launch several processes with LaunchExecutableEx but do not call RetireExecutableHandle on them, you might reach the limit for the maximum number of processes the system imposes. This happens even if the processes terminate; the program does not recognize that the processes have terminated until you call RetireExecutableHandle.



Prototype

int LaunchExecutableEx (char Filename[], int Window_State, int *Handle);
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-4-22 10:47 , Processed in 0.394074 second(s), 9 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表