NOTICE: Our Community is moving. Get more information.
Customer is developing a Windows Forms application in Visual COBOL for Visual Studio and they are looking for a way to start a non-COBOL executable like a text editor directly from within their application.
How can this be done?
You can use the .NET framework Process class to execute all types of programs including .EXEs or to launch an application such as an editor by specifying just a filename to associate with it.
Look at the following link which provides some good examples:
The following example will execute the text editor such as notepad that is associated with the .txt extension on your system and open up the file example.txt.
$set ilusing"System.Diagnostics" class-id execprogram.Form1 is partial inherits type System.Windows.Forms.Form. working-storage section. method-id NEW. procedure division. invoke self::InitializeComponent goback. end method.
method-id button1_Click final private. procedure division using by value sender as object e as type System.EventArgs. invoke type Process::Start("example.txt") goback. end method.