Home > Software engineering >  ShellExecute problems to open the text file
ShellExecute problems to open the text file

Time:10-11

In a dialog box with multiple text box, and a button (button) controls,
Click on the button corresponding to the function, decodes
: : ShellExecute (NULL, "open", "NotePad. Exe", "Ri. TXT", NULL, SW_SHOWNORMAL);
Open a TXT file, but there were no open notepad, but in a text box in the dialog box opens the contents of a text file, and is full of "hot" words, if a double-click to open the text file in folder, content with Chinese characters, letters and Numbers, were written in the program,

The question is, how to use the ShellExecute function calls "NotePad. Exe" to open the text file, not to open the content into the dialog box shown in the text box control for the code?

CodePudding user response:

Content is garbled, this has nothing to do with you open, can directly open the first, and see that inside the code, if it is in itself the code, then in what way you open all the same, also want to open a TXT file of execution, written the TXT file's path absolute path

CodePudding user response:

Directly open the t file, the content is right, contains Chinese characters, letters and Numbers, etc.

Not tried as an absolute path, or

CodePudding user response:

Has built a project, found in the title statement is feasible given

Then drag a button to the dialog box, paste the statement to the button's onclick function, so that the

But the original functions under the button or not make, somehow the

CodePudding user response:

It's not right, you just
: : ShellExecute (NULL, "open", "Ri. TXT", NULL, NULL, SW_SHOWNORMAL);
Have a try

CodePudding user response:

reference sleuth_cn reply: 3/f
has built a project, found in the title statement is feasible given

Then drag a button to the dialog box, paste the statement to the button's onclick function, so that the

But the original functions under the button or not make, somehow the
that you post code and add a breakpoint

CodePudding user response:

Two functions in the same class of a good with a bad to use? Add a breakpoint to look at?
  • Related