ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / DDE functions
  • Limits
  • Default values
  • Triggering the same procedure for several events
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
DDEEvent (Function)
In french: DDEEvénement
Associates a WLanguage procedure with a DDE event: when the DDE event occurs, the associated WLanguage procedure is automatically run.
Remark: This function must only be used for the "New DDE dialog" of WINDEV or WEBDEV.
Example
WINDEVUser code (UMC)
// Trigger a call to the "DataReception" procedure whenever
// the program receives a data sent via DDE by another application
DDEEvent("DataReception", DDEtoReceive)
PROCEDURE DataReception
IF (_DDE.Topic = "MySubject") AND (_DDE.Item = "MyItem") THEN
_DDE.Cr = 1
Info("Data received: " + _DDE.String)
ELSE
_DDE.Cr = 0
END
Syntax
DDEEvent(<Procedure name> , <DDE events>)
<Procedure name>: Character string
Name of WLanguage procedure to run. This procedure can be a global procedure or a local procedure of current window. If this parameter corresponds to an empty string (""), the "Procedure - DDE Event" association is canceled.
<DDE events>: Integer constant (or combination of constants)
DDEtoAnswerThe program receives a request for data from another application.
<Procedure> can find out the topic and the item affected by _DDE.Topic and _DDE.Item (_DDE.String has no significant value).
  • If the request for data is accepted, <Procedure> must update:
    • _DDE.Cr = 1
    • _DDE.String = <value to send to the application that made the request>
  • If the request for data is not accepted, <Procedure> must update _DDE.Cr = 0
DDEtoExecuteThe program receives a command to run that comes from another application.
<Procedure> can find out the topic affected by _DDE.Topic and the data received by _DDE.String (_DDE.Item has no significant value).
  • If the command is run, <Procedure> must update _DDE.Cr = 1
  • If the command is not run, <Procedure> must update _DDE.Cr = 0
DDEtoLinkThe program receives a request for a "warm" or "hot" link to a data. This request comes from another application.
<Procedure> can find out the topic and the item affected by _DDE.Topic and _DDE.Item (_DDE.String has no significant value).
  • If the link is created, the program must call DDEUpdate whenever the data corresponding to the topic and to the item is modified. <Procedure> must update _DDE.Cr = 1
  • If the link is not created, <Procedure> must update _DDE.Cr = 0
DDEtoModifyThe program receives the signal that the value of a linked data was modified. This signal comes from another application.
After the DDEtoModify event, you must call DDELink or DDEWarmLink in order for <Procedure> to be called.
<Procedure> can find out the topic and the item affected by _DDE.Topic and _DDE.Item.
  • If the modification is accepted, <Procedure> must update _DDE.Cr = 1
  • If the modification is not accepted, <Procedure> must update _DDE.Cr = 0
  • If the link is a hot link, _DDE.String contains the new value of the linked data; otherwise, _DDE.String is set to "" (empty string)
DDEtoReceiveThe program receives a data from another application.
<Procedure> can find out the topic and the item afected by _DDE.Topic and _DDE.Item and the data received by _DDE.String.
  • If the data is accepted, <Procedure> must update _DDE.Cr = 1
  • If the data is not accepted, <Procedure> must update _DDE.Cr = 0
Remarks

Limits

  • DDEEvent cannot be called in the class constructor or destructor.
  • Multitask must not be run in a procedure called by DDEEvent.
  • The debugger cannot be called by Ctrl + Pause in a procedure called by DDEEvent. You must add the Stop keyword.

Default values

By default, _DDE.Cr is set to 1 (OK) and _DDE.String is set to "" (empty string).

Triggering the same procedure for several events

The same procedure can be triggered by the action of several DDE events. In this case, the syntax is for example:
DDEEvent("DataReception", DDEtoReceive + DDEtoModify)
For these two events, you must identify in <Procedure name> the DDE event that triggered the call to the procedure. To do so, you must check the _DDE.Event variable.
The _DDE.Event variable returns, according to the case:
  • DDEtoAnswer.
  • DDEtoReceive.
  • DDEtoExecute.
  • DDEtoLink.
  • DDEtoModify.
Component: wd290std.dll
See also
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help