aMSN Forums
May 19, 2013, 07:56:58 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: start amsn.exe from an external application  (Read 4075 times)
ich
Newbie

Offline Offline

Posts: 3


View Profile
« on: July 25, 2006, 03:24:50 pm »

Hi,

i need a possibility to start the amsn.exe from an external application.
the standard windows API functions (like CreateProcess(), ShellExecute(), ShellExecuteEx(),WinExec() etc.) terminates with  error message "Error: 2" .
if i try to start the amsn.exe by the command Prompt and the system() Function, i have the same error.
Is the only way to start this program by a doubleclick on the  Programs Icon or  the Programs Exefile?

What can i do?
Logged
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #1 on: July 25, 2006, 03:54:52 pm »

This has been discussed somewhere in this forum, that was an issue with aMSN, that occured when starting aMSN from the regestry. After a little research, Devs figured out Error 2 stands for "File not found" and this happens because of "Working directory". aMSN.exe simply calls a file inside a sub-folder (can't recall which), but you have to set the Work. Dir. to wherever aMSN.exe is Smiley that will do it Wink
Logged
billiob
Administrator
Super Power User
*****
Offline Offline

Posts: 1352


View Profile
« Reply #2 on: July 25, 2006, 05:42:34 pm »

Actually, the amsn.exe is one executable that does :
Code:
void main() {
   system("./bin/wish.exe ./scripts/amsn");
}
Logged
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #3 on: July 25, 2006, 06:17:14 pm »

So maybe it could be:

Code:
int main(int argc, char* argv[]) {
  if (argc == 1)
   return system("./bin/wish.exe ./scripts/amsn");
  else
   return system(argv[1]);
}

aMSN.exe would still work as it is now, and it could be called like this:

Code:
aMSN.exe "c:/progs/amsn/bin/wish.exe c:/progs/amsn/scripts/amsn"


(Hey I just programmed this function right here in-forum, I didn't even compile or test it, it's just """pseudo"" code" (almost real Tongue))
Logged
ich
Newbie

Offline Offline

Posts: 3


View Profile
« Reply #4 on: July 25, 2006, 06:44:04 pm »

The Problem was the workdir
now it works ;-)

Code:
ShellExecute(Handle, NULL, "c:\\programme\\amsn\\bin\\wish.exe", "c:\\programme\\amsn\\scripts\\amsn", NULL, SW_SHOWNORMAL);


many THX for your reply
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!