Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Windows Dynamic Data Exchange : Opening DDE conversations : Defining DDE frames
 
Defining DDE frames
To open a conversation, you must first define a named frame to use as the DDE frame for the conversation. Make sure that you define the DDE frame in a scope large enough to complete the intended conversation. If you are unsure, use a FORM or DEFINE FRAME statement to define the frame for the scope of the procedure(s) that invoke DDE exchanges. For example, the following code defines and enables a frame for the procedure scope to start and manage conversations with Microsoft Excel:
DEFINE VARIABLE listx AS CHARACTER NO-UNDO
  VIEW-AS SELECTION-LIST SIZE 36 BY 5.
DEFINE VARIABLE ed AS CHARACTER NO-UNDO
  VIEW-AS EDITOR SIZE 20 by 2.

DEFINE BUTTON bq LABEL "Quit".
DEFINE BUTTON bg LABEL "Start Excel".
...

DEFINE FRAME MainFrame
  SKIP(1) SPACE(1) bq SPACE(1) bg SPACE(1) SKIP(1)
  SPACE(1) listx LABEL "DDE History" SPACE(1) SKIP(1)
  SPACE(1) ed LABEL "Cell R4C2 (Row 4 Col B)" SKIP(1)
  WITH SIDE-LABELS.
ENABLE ALL WITH FRAME MainFrame TITLE "Main Frame".
...
If you want your application to completely hide DDE conversations from the user, always define your DDE frames as procedure-scoped static frames without fields and set their HIDDEN attributes to TRUE after realizing the frames. This prevents the user from doing anything that might compromise DDE communications, such as invoking an option that inadvertently destroys the frame in mid-conversation.