|
도움말의 일부를 보면..
HINSTANCE ShellExecute(
HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);
Parameters
...(중략)..
lpParameters
If lpFile specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies parameters to be passed to the application.
If lpFile specifies a document file, lpParameters should be NULL.
...(생략)...
대충 짧은 영어실력으로 번역해보면..
[LpParameters]의 값
1.lpFile이 실행가능한 파일을 명시할 때: 응용프로그램에 전달되는 매개변수를 명시하는 문자열(null로 끊나지 않는)의 포인터.
2.lpFile이 문서 화일을 명시할 때: NULL.
근데 저는 내용(1)의 의미는 모르겠네요.
아마 LpParameters값을 NULL로 해서 에러가 난 것 같군요.
실행파일은 NULL이 아닌가 봅니다.
: for (int i=0;Check_List->Count; i++)
: ShellExecute(Handle, "open", Check_List->Strings[i].c_str(), NULL /*여기*/,
: NULL, SW_SHOW);
제가 쓴 글이 틀릴수도 있습니다.
그럼 이만....고생하세요..
통일바라기 님이 쓰신 글 :
:
: 아래는 RealTime_Check를 클릭했을 때,
: Program_List.txt 파일을 읽어들여서 해당 라인만큼의
: ShellExecute API를 반복수행시키고자 작성한 것입니다.
:
: 그런데, 텍스트 파일 내용이
:
: 파일 내용1) ".txt" 형태의 파일인 경우에는 모두 정상적으로 수행되는데
: - TelNet.exe 파일은 뮤텍스를 이용하여 반복수행되지 않도록 작성)
:
: C:\\Temp\\TelNet.exe(또는 C:\Temp\TelNet.exe)
: C:\Temp\ProgramCheck\List1.txt
:
: 파일 내용2) ".exe" 형태의 실행파일이 포함되면 에러가 나옵니다.
: C:\Temp\List1.txt
: C:\Temp\List2.txt
: C:\Temp\ProgramCheck\List1.txt
: C:\Temp\ProgramCheck\List2.txt
:
:
: -----------------------------------------------------------------------------------
: void __fastcall TForm1::RealTime_CheckClick(TObject *Sender)
: {
:
: TStringList *Check_List = new TStringList(); // 검색문자열
: Check_List->LoadFromFile("C:\\Temp\\ProgramCheck\\Program_List.txt");
:
: for (int i=0;Check_List->Count; i++)
: ShellExecute(Handle, "open", Check_List->Strings[i].c_str(), NULL,
: NULL, SW_SHOW);
:
: delete Check_List;
: }
: -----------------------------------------------------------------------------------
:
: 답변에 미리 감사드립니다.
:
:
|