Unit11.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
源码类别:

VC书籍

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit11.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. //---------------------------------------------------------------------------
  10. __fastcall TForm1::TForm1(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TForm1::Button1Click(TObject *Sender)
  16. {
  17.   if(DdeClientConv1->OpenLink())
  18.   {
  19.     ShowMessage("已连接");
  20.   }
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::Button2Click(TObject *Sender)
  24. {
  25.   DdeClientConv1->CloseLink();
  26. }
  27. //---------------------------------------------------------------------------
  28. void __fastcall TForm1::Button3Click(TObject *Sender)
  29. {
  30.   if(DdeClientConv1->ExecuteMacro("DDE1234 245235", True))
  31.     ShowMessage("发送成功!");
  32.   else
  33.     ShowMessage("发送失败!");
  34. }
  35. //---------------------------------------------------------------------------
  36. void __fastcall TForm1::Button4Click(TObject *Sender)
  37. {
  38.   if(DdeClientConv1->PokeDataLines(DdeClientItem1->DdeItem, Memo1->Lines))
  39.     ShowMessage("发送成功!");
  40.   else
  41.     ShowMessage("发送失败!");
  42. }
  43. //---------------------------------------------------------------------------