INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How can one trigger Application 2 from Application 1?

How can one trigger Application 2 from Application 1?

(OP)
I need to trigger Application 2 "NumbersUpdate.exe" from Application 1 "MyProg.exe".

The following initiating from "MyProg.exe" produces exception "class EInvalidPointer with message
'Invalid [pointer operation'".

WinExec('c:\Program Files\MyPrograms\NumbersUpdate.exe', SW_SHOWNORMAL);

What am I missing?

Thanks in advance for this urgently needed help.

delphiman

Old Man Delphi

RE: How can one trigger Application 2 from Application 1?

Try something like this

CODE

procedure TriggerNumbersUpdate; 
var
   AppName: array[0..512] of char;
   path: string;
begin
   Path := '"c:\Program Files\MyPrograms\NumbersUpdate.exe"';
   FillChar(AppName, SizeOf(AppName), #0);
   StrPCopy(AppName, Path);
   ShellExecute(0, 'open', AppName, nil, nil, SW_SHOWNORMAL);
end; 

if not already there, add ShellApi to your uses clause.

RE: How can one trigger Application 2 from Application 1?

(OP)
Thank you Majlumbo!

I was about to post that I had resolved my problem with the following

WinExec('c:\Program Files\MyPrograms\NumbersUpdate.exe', SW_SHOW);

You got in just ahead of me.

Haven't tried it but it seems your suggestions will work too!

Thanks again!

Old Man Delphi

RE: How can one trigger Application 2 from Application 1?

(OP)
YUP! Tried your solution. It works too! Thanks again! 2thumbsup

Old Man Delphi

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close