ScottParker
asked on
Trigger windows sound from AS/400 program
Greetings,
I am trying to figure out if there is a way for an RPG or ILE program to trigger the playing of a sound file.
The "Beep" that we could do, is not sufficent in this case.
I want to have a .wav file, that is stored on the PC played.
Any ideas?
I am trying to figure out if there is a way for an RPG or ILE program to trigger the playing of a sound file.
The "Beep" that we could do, is not sufficent in this case.
I want to have a .wav file, that is stored on the PC played.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have the RUNRMTCMD working for another program I made. So I know that the "Incoming Remote Command" option is correct.
ASKER
I added a 1/2 a second delay in the windows program. Once I did that, everything worked fine.
Incoming remote command is going to spawn your program in another session, which may cause a problem for applications that need to interact with the user's session (including sound, I'm guessing). You may be able to cure this by making sure the service is configured to interact with the desktop:
http://www.mcpressonline.com/programming/rpg/calling-a-pc-application-from-rpg-part-iii.html
Otherwise, you can try this instead. STRPCCMD uses a different approach to start a PC command, and may not work through all emulators, though it should work fine with Client Access.
STRPCO
STRPCCMD
Another alternative, since you clearly know VB, is to write a little VB program that runs in the users session that uses the CA data queue APIs to watch an AS/400 data queue. Entries placed on the data queue on the AS/400 can be used to trigger various programs in the user's session (or could even contain a command string itself).
- Gary Patterson
http://www.mcpressonline.com/programming/rpg/calling-a-pc-application-from-rpg-part-iii.html
Otherwise, you can try this instead. STRPCCMD uses a different approach to start a PC command, and may not work through all emulators, though it should work fine with Client Access.
STRPCO
STRPCCMD
Another alternative, since you clearly know VB, is to write a little VB program that runs in the users session that uses the CA data queue APIs to watch an AS/400 data queue. Entries placed on the data queue on the AS/400 can be used to trigger various programs in the user's session (or could even contain a command string itself).
- Gary Patterson
ASKER
It "Opens" when I call it using the RUNRMTCMD from the AS/400 but the sound does not play.
here is the code... Any Ideas? I have also tried changing the WAITTIME(*NOMAX) and it didnt help.
JGPCPGM: PGM
DCL VAR(&STRING ) TYPE(*CHAR) LEN(200)
CHGVAR VAR(&STRING) VALUE('"C:\PlaySound\PlayS
RUNRMTCMD CMD(&STRING) RMTLOCNAME('172.16.104.80'
EOJ:
ENDPGM