aj85
asked on
EASY QUESTION FOR POINTS
Raymond/ rwilson,
On the code example you gave to me before, how can I have a window pop-up and stay on top until the other application is finished? Then clear out and then display a message of completion? I have tried modifing your previous example that work just fine for that purpose, but when I changed it to not use a timer I keep getting "Access Errors". Remember that this is being used in a "DLL".
Thanks
Tony
ASKER
Raymond,
Here is the code:
Function RunMyProcess : integer; //TJ
var si : TStartupInfo;
pi : TProcessInformation;
dw1 : dword;
MergeCmd: ANSIString;
enabled: boolean;
begin
enabled:=false;
MergeCmd:= 'C:\MSSQL7\MERGE\Merge.Exe
ZeroMemory(@si,sizeOf(si))
si.dwFlags:=STARTF_USESHOW
if CreateProcess(nil,PChar(Me
then begin
with TRunThread.Create(true) do
try
processHandle:=pi.hProcess
processReady:=false;
waitingThread:=GetCurrentT
// Error happens here.... When I try to call the form
Resume;
repeat
Application.HandleMessage;
until Application.Terminated or processReady;
finally Free end;
GetExitCodeProcess(pi.hPro
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
begin
if (dw1) = 0 then
ShowTimedMessage('Merge Successful!', 5)
else
if (dw1) = 1 then
ShowTimedMessage('Merge Unsuccessful! Please retry....', 5);
// ShowTimedMessage('Test (exitCode='+IntToStr(dw1)+
end;
end;
end;
Thanks,
Tony
Tony,
Can you post the code that you use at thsi comment:
// Error happens here.... When I try to call the form
At least I'll be able to see what is going wrong...
Cheers,
Raymond.
Can you post the code that you use at thsi comment:
// Error happens here.... When I try to call the form
At least I'll be able to see what is going wrong...
Cheers,
Raymond.
ASKER
Raymond,
I simply call a from called frmUtil.
Code: frmUtil.show
I then close it later after the application has terminated.
code: frmUtil.close
I know this is where the error is, I am just not sure why?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Raymond.
Create and show the form before starting the process, and after the process has completed close and release it.
Perhaps you could post the code you have now with an indication where the error occurs?
Cheers,
Raymond.