Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Paths for Remote Terminal

Status
Not open for further replies.

aaiqbal

Programmer
Sep 15, 2003
26
US
Hi Again,
I wanted to know when you open another ProComm window using DDEInit, can you also set that terminal's paths using "set upldpath" or "set capture filename"? If so, is there a DDE command that does this? Thanks for all of the help all of you have provided and thanks in advance for any help you can provide.
 
I have not had a chance to test this yet, but the help file (search for DDE advanced topics I believe) indicates this is possible. Here is a snippet:

In addition to running script files and determining the current value of the predefined global variables, a client Windows application may request Procomm Plus to execute a command. Procomm Plus, when acting as a DDE server, acts on the following commands received from a DDE client:

ASPECTCMD string
CAPTURE OFF | ON
DIAL {DATA | FAX | VOICE | FTP | TELNET} [GROUP] name [DIALINGBOX OFF]
DIALLOAD filespec
EXECUTE filespec
GETFILE string [filespec] [FILEXFERBOX OFF]
HALT
HANGUP
PWEXIT
SENDFILE string [filespec] [FILEXFERBOX OFF]
TRANSMIT string

So you should be able to use ddeexecute with ASPECTCMD set etc. etc. to make this change. Keep in mind that this change will also be apparent in the instance of Procomm that is acting as the DDE client.


aspect@aspectscripting.com
 
I tried this using "ddeexecute ASPECTCMD "set capture..." " but the compiler doesn't like the word "ASPECTCMD". I also typed in the example "ASPECTCMD USERMSG "The time is: %s" $TIME" and it still didn't recognize "ASPECTCMD". Would it work if I used "ddeexecute DDECHAN "set capture ..." "? I tried it and there were no compilation errors but the commands didn't seem to do anything. When I looked at the other window and its' paths, they were the same as before even though I changed the upload, download and capture paths.
 
Here is a sample script that shows the syntax to use. This script will open a second Procomm window, then use the ddeexecute command to display a message box using the usermsg command in the new window.

proc main
string pathname
integer pwhwnd
long pwchanid

pathname = $pwtaskpath ;Get PW's path.
addfilename pathname "PW5.EXE" ;Add Procomm's EXE.
if run pathname ;Run the program.
pause 2
pwhwnd = $mainwin ;Get the active window ID.
if ddeinit pwchanid "PW5" "System" pwhwnd ;Establish DDE connection.
ddeexecute pwchanid "EXECUTE HINTS.WAX"
usermsg "DDE channel successfully established!"
else
errormsg "Error initializing DDE channel"
endif
else ;Problems running program.
errormsg "Error running %s" pathname
endif
endproc



aspect@aspectscripting.com
 
I'm not having problems opening a new window or running a script in that window. However, I'm trying to change the paths of that window dynamically from my window. I can change the paths in my own window with commands like
"set capture path ..." or "set dnldpath ..." and I would like to do the exact same thing in the remote window. The reason for this is based on the test I'm running, the path of that test will be different and the remote window will need the path of the current test, not the last test as it will have. Of course, if I manually change the paths in my window (before running the script) then when the remote window opens up, it too will have the same paths. I just don't want to have to do that everytime. Is there a way to do this? It seems as though the ASPECTCMD only supports the commands knob listed above and no others. This means, apparently, I can't use it to set the paths of the remote window. I did attempt to use:
ddeexecute "set capture path ..." and there were not compilation errors but that didn't really seem to work either since the paths were still the same as before in the remote window. Thanks for looking at this and any help would be appreciated.
 
Sorry, I wasn't clear when I posted my sample (and I'm thinking I may have posted in the wrong script). You should be able change"EXECUTE HINTS.WAX" in the above script to "ASPECTCMD set ..."



aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top