| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > C++ Builder > параметры в GUI программе |
| Автор: szz 26.12.2005, 23:00 |
| Я пишу гуи-программу (стандартная Application), a запустить ее нужно через командную строку, присем чтоб ей передались аргументы, например Project1.exe argument1 argument2 но так как функции main(int argc, char **argv) нету, то я не знаю как получить эти параметры. Помогите!!! |
| Автор: Aleksandor 26.12.2005, 23:34 |
| ANSI console processes written in C can use the argc and argv arguments of the main function to access the command-line arguments. ANSI GUI applications can use the lpCmdLine parameter of the WinMain function to access the command-line string, excluding the program name. The reason that main and WinMain cannot return Unicode strings is that argc, argv, and lpCmdLine use the LPSTR data type for parameters, not the LPTSTR data type. The GetCommandLine function can be used to access Unicode strings, because it uses the LPTSTR data type. To convert the command line to an argv style array of strings, call the CommandLineToArgvW function. Note The name of the executable in the command line that the operating system provides to a process is not necessarily identical to that in the command line that the calling process gives to the CreateProcess function. The operating system may prepend a fully qualified path to an executable name that is provided without a fully qualified path. |
| Автор: szz 27.12.2005, 00:08 |
| То что надо, сапсибо! |