Header File
-
I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?
-
I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?
Windows.h
. Also, consider usingShellExecute
as an alternative. :) Regards, BB http://spin.bartoszbien.com -
I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?
Sweet Flame wrote: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); Just a note: You'll need to escape the backslash. The '\' character in a string signifies a special character. You need to use: WinExec("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE", SW_SHOWNORMAL);