Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2006.07.16;
Скачать: [xml.tar.bz2];

Вниз

запуск с параметрами   Найти похожие ветки 

 
manevil   (2006-06-26 11:22) [0]

Добрый день. Помогите, плиз.
Такая проблема: нужно запускать консольное приложение (чужое) с параметрами. Как это сделать?
ShellExecute(0, nil, PChar("c:\bin\gbak.exe -b ***"), nil, nil, SW_SHOWNORMAL) так не получается :(


 
novill ©   (2006-06-26 11:26) [1]

И что пишет?


 
Dmitrij_K   (2006-06-26 11:26) [2]

Может так?
ShellExecute(0, "c:\bin\gbak.exe", "-b ***", nil, nil, SW_SHOWNORMAL)


 
Dmitrij_K   (2006-06-26 11:31) [3]

Ошибся
ShellExecute(0, nil, "c:\bin\gbak.exe", "-b ***", nil, SW_SHOWNORMAL)


 
manevil   (2006-06-26 11:33) [4]

в том то и дело, что ничего не пишет, если точно также пытаться запускать *.bat файл с той же строкой, то все проходит нормально, а так ничего...


 
novill ©   (2006-06-26 11:36) [5]

Читаем мсдн:
HINSTANCE ShellExecute(          HWND hwnd,
   LPCTSTR lpOperation,
   LPCTSTR lpFile,
   LPCTSTR lpParameters,
   LPCTSTR lpDirectory,
   INT nShowCmd
);

...................

Return Value

Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an int and compare it with the value 32 or one of the error codes below.

0 The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ERROR_BAD_FORMAT The .exe file is invalid (non-Microsoft Win32® .exe or error in .exe image).
SE_ERR_ACCESSDENIED The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE The file name association is incomplete or invalid.
SE_ERR_DDEBUSY The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL The DDE transaction failed.
SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND The specified dynamic-link library (DLL) was not found.
SE_ERR_FNF The specified file was not found.
SE_ERR_NOASSOC There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM There was not enough memory to complete the operation.
SE_ERR_PNF The specified path was not found.
SE_ERR_SHARE A sharing violation occurred.


 
manevil   (2006-06-26 11:36) [6]


> Dmitrij_K
Спасибо. Так работает.


 
manevil   (2006-06-26 11:40) [7]


> novill

спасибо за справку, кстати )



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2006.07.16;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.011 c
1-1149586836
Dyakon_Frost
2006-06-06 13:40
2006.07.16
Потоки - Загрузка процессора


2-1151489711
0bsid
2006-06-28 14:15
2006.07.16
фокус ввода


1-1149666613
DevilDevil
2006-06-07 11:50
2006.07.16
1С & Delphi


6-1141869741
AleKo
2006-03-09 05:02
2006.07.16
idPOP3


3-1147842962
syte_ser78
2006-05-17 09:16
2006.07.16
Помогите с востановлением базы





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский