LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LaunchExecutableEx and NotePad - again

This question was answered, but did not make sense to me. Will someone else give it a try?

Can I use the LaunchExecutableEx command to launch notepad.exe, but make notepad automatically open a specific file that is stored in a variable in my program?
0 Kudos
Message 1 of 2
(2,935 Views)
The answer is yes. The function panel help for the Filename parameter of LaunchExecutableEx shows an example of this.

Copy the following code into the interactive execution window and run it. Create a file named C:\temp.txt.

#include
#include
#include "userint.h"

static char *filename = "c:\\temp.txt";
static char *viewer = "notepad.exe";
static char buffer[(MAX_PATHNAME_LEN * 2) + 1];

sprintf(buffer, "%s %s", viewer, filename);
LaunchExecutableEx (buffer, LE_SHOWNORMAL, NULL);

Hope this helps,
David Rohacek
National Instruments
0 Kudos
Message 2 of 2
(2,935 Views)