I zipped up the samples from the 4.8 CD and placed them at
Also, here is the text of the ddeadvise discussion from the ASPECT help file, including the example script:
Allows Procomm Plus to request both the initial value of a variable and any subsequent changes to that variable from a Windows Dynamic Data Exchange (DDE) server. Each time the value of the specified variable changes in the server application, Procomm Plus is informed of the change.
long Specifies the DDE channel number returned by the ddeinit command.
string The name of the server variable to be monitored.
gdatavar The name of the Procomm Plus global data variable that will be changed each time the server sends a new value for the specified variable.
integer An optional identifier, indicating when a specific variable among multiple ddeadvise commands has been updated. The value is used in conjunction with the $DDEADVISE system variable to indicate which ddeadvise command has been updated. The value must be a positive, non-zero value. If not specified, events associated with the server variable will return -1 in $DDEADVISE.
Example
string szText ; Text read from DDE link to Excel.
proc main
long LinkVar, SystemVar ; Variables containing DDE Id's.
; Set up DDE links to Excel's system and a spreadsheet. Excel
; must be running in order for this script to work properly.
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[FULL(TRUE)]" ; Maximize the spreadsheet.
if ddeinit LinkVar "excel" "sheet1" ; Set up link to spreadsheet.
ddepoke LinkVar "R1C1" "Procomm Plus DDE example!"
dderequest LinkVar "R1C1" szText ; Read info from DDEPOKE.
usermsg szText ; Display text on status line.
ddeadvise LinkVar "R1C1" szText ; Make hot link to row 1,
; col 1 of the spreadsheet.
while 1 ; Loop forever.
if $DDEADVISE
; See if row 1 and col 1 of spreadsheet
; changed, if so read it and evaluate.
if stricmp szText "exit`r`n"
exitwhile ; Exit the while loop.
else
usermsg szText ; Display cell contents.
endif
endif
endwhile
ddeunadvise LinkVar "R1C1" ; Break hot link to spreadsheet.
ddeterminate LinkVar ; Break DDE link to spreadsheet.
ddeterminate SystemVar ; Break DDE link to Excel.
else
errormsg "Couldn't establish DDE link to spreadsheet!"
endif
else
errormsg "Couldn't establish DDE link to Excel!"
endif
endproc
Comments
A ddeadvise operation can be tested with the if SUCCESS statement, returning true if the operation was successful and false if it failed.
The DDE manager only maintains one advise loop per item per conversation. More than one ddeadvise can be established on the same item, and each can be uniquely identified by using the optional ID. A ddeunadvise, however, will terminate all active advisements on that item.