Q&A

  • 여기서 에러가 나요.
Q&A란의 자료를 다운받아서 그대로 쓰려고 하는데 자꾸 에러가 납니다.

에러 내용은 다음과 같읍니다.

이유좀 가르쳐 주세요.

초보라서 제가 만들 실력은 안되고 그냥 있는것 쓰려는데 에러가 납니다.



[Error] MAIN.PAS(287): Types of actual and formal var parameters must be identical



function TForm_main.WinExecAndWait32(Path: PChar;

Visibility: Word): integer;

var

Msg: TMsg;

lpExitCode : integer;

StartupInfo: TStartupInfo;

ProcessInfo: TProcessInformation;

begin

FillChar(StartupInfo, SizeOf(TStartupInfo), 0);

with StartupInfo do

begin

cb := SizeOf(TStartupInfo);

dwFlags := STARTF_USESHOWWINDOW ;//or STARTF_FORCEONFEEDBACK

wShowWindow := visibility;

end;

if CreateProcess(nil, path, nil, nil, False,

NORMAL_PRIORITY_CLASS ,

nil, nil, StartupInfo, ProcessInfo) then //OR CREATE_SEPARATE_WOW_VDM

begin

repeat

while PeekMessage(Msg, 0, 0, 0, pm_Remove) do

begin

if Msg.Message = wm_Quit then

Halt(Msg.WParam);

TranslateMessage(Msg);

DispatchMessage(Msg);

end;

///////////////////////////////////////////////////////////////////////

//에러발생 GetExitCodeProcess(ProcessInfo.hProcess,lpExitCode);/////

///////////////////////////////////////////////////////////////////////

until (lpExitCode <> Still_Active);

with ProcessInfo do

begin

CloseHandle(hThread);

CloseHandle(hProcess);

end;

Result := 0; {sucess}

end

else

Result := GetLastError; {error occurs during CreateProcess}

end;





2  COMMENTS
  • Profile
    최용일 2001.10.23 03:38
    안녕하세요. 최용일입니다.



    델파이 버전간의 함수프로토타입차이같네요..



    아래와 같이 해보세요...



    GetExitCodeProcess(ProcessInfo.hProcess, Cardinal(lpExitCode));



    ^^ 항상 즐코하세요...



    신호 wrote:

    > Q&A란의 자료를 다운받아서 그대로 쓰려고 하는데 자꾸 에러가 납니다.

    > 에러 내용은 다음과 같읍니다.

    > 이유좀 가르쳐 주세요.

    > 초보라서 제가 만들 실력은 안되고 그냥 있는것 쓰려는데 에러가 납니다.

    >

    > [Error] MAIN.PAS(287): Types of actual and formal var parameters must be identical

    >

    > function TForm_main.WinExecAndWait32(Path: PChar;

    > Visibility: Word): integer;

    > var

    > Msg: TMsg;

    > lpExitCode : integer;

    > StartupInfo: TStartupInfo;

    > ProcessInfo: TProcessInformation;

    > begin

    > FillChar(StartupInfo, SizeOf(TStartupInfo), 0);

    > with StartupInfo do

    > begin

    > cb := SizeOf(TStartupInfo);

    > dwFlags := STARTF_USESHOWWINDOW ;//or STARTF_FORCEONFEEDBACK

    > wShowWindow := visibility;

    > end;

    > if CreateProcess(nil, path, nil, nil, False,

    > NORMAL_PRIORITY_CLASS ,

    > nil, nil, StartupInfo, ProcessInfo) then //OR CREATE_SEPARATE_WOW_VDM

    > begin

    > repeat

    > while PeekMessage(Msg, 0, 0, 0, pm_Remove) do

    > begin

    > if Msg.Message = wm_Quit then

    > Halt(Msg.WParam);

    > TranslateMessage(Msg);

    > DispatchMessage(Msg);

    > end;

    > ///////////////////////////////////////////////////////////////////////

    > //에러발생 GetExitCodeProcess(ProcessInfo.hProcess,lpExitCode);/////

    > ///////////////////////////////////////////////////////////////////////

    > until (lpExitCode <> Still_Active);

    > with ProcessInfo do

    > begin

    > CloseHandle(hThread);

    > CloseHandle(hProcess);

    > end;

    > Result := 0; {sucess}

    > end

    > else

    > Result := GetLastError; {error occurs during CreateProcess}

    > end;

    >

    >

  • Profile
    신호 2001.10.23 17:42
    내용무