home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmdde.zip / POST.E < prev    next >
Text File  |  1995-11-10  |  2KB  |  33 lines

  1. -- This Macro shows how to send information from EPM back to the
  2. -- client application in a DDE conversation. EPM_EDIT_DDE_POST_MSG has the
  3. -- parameters mp1 being set to the item name, and mp2 set to the data both
  4. -- corresponding to the item and data fields of the DDESTRUCT type defined
  5. -- in the OS/2 2.0 toolkit. EPM Accepts this message and packages the
  6. -- parameters into a DDESTRUCT and sends it back to the client application
  7. -- with a WM_DDE_DATA message.
  8.  
  9. -- To demonstrate DDE interaction start DDESAMP.exe and EPM version 6.03a.
  10. -- (Recompile post.e with the appropriate version of ETPM to use with a
  11. -- different version of EPM 6.)
  12. -- In DDESAMP initiate a DDE conversation.  When DDESAMP is communicating with
  13. -- EPM you should hear a beep.  Next send EPM the command 'link post.ex' which
  14. -- will link this macro post.ex.  Now that post.ex is linked send the
  15. -- command post 'string1' 'string2', where string1 and string2 are two
  16. -- arbitrary strings. EPM will receive the message and execute the post
  17. -- macro. The post macro appends * characters to both of the strings
  18. -- and sends them back to DDESAMP with a WM_DDE_DATA message.
  19. -- When DDESAMP receives the WM_DDE_DATA message it will pop up a message
  20. -- box with the data sent back in the item and data fields of DDESTRUCT.
  21.  
  22. include 'stdconst.e'  -- Needed for EPMINFO_EDITCLIENT constant
  23.  
  24. defc post =  -- Sample command
  25.      sayerror 'POST command called.'
  26.      parse value arg(1) with NameString DataString
  27.      mp1_str = '****'NameString'****'\0  -- Append \0 for an ASCIIZ string.
  28.      mp2_str = '****'DataString'****'\0
  29.      windowmessage(1,  getpminfo(EPMINFO_EDITCLIENT),
  30.                    5478,    -- EPM_EDIT_DDE_POST_MSG
  31.                    ltoa(offset(mp1_str) || selector(mp1_str), 10),
  32.                    ltoa(offset(mp2_str) || selector(mp2_str), 10));
  33.