MyClient.cpp
上传用户:lulishicai
上传日期:2010-03-01
资源大小:13202k
文件大小:1k
源码类别:

Delphi/CppBuilder

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "MyClient.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TClientForm *ClientForm;
  9. //---------------------------------------------------------------------------
  10. __fastcall TClientForm::TClientForm(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TClientForm::Button1Click(TObject *Sender)
  16. {
  17. DdeClientConv1->SetLink("Server","DdeServerConv1");
  18. DdeClientItem1->DdeItem="DdeServerItem1";
  19. }
  20. //---------------------------------------------------------------------------
  21. void __fastcall TClientForm::DdeClientItem1Change(TObject *Sender)
  22. {
  23. Memo1->Lines=DdeClientItem1->Lines;        
  24. }
  25. //---------------------------------------------------------------------------
  26. void __fastcall TClientForm::Button2Click(TObject *Sender)
  27. {
  28.   TDdeClientConv *DdeClient;
  29.   DdeClient=DdeClientItem1->DdeConv;
  30.   if(DdeClient!=NULL)
  31.   DdeClient->PokeDataLines("DdeServerItem1",Memo2->Lines);
  32. }
  33. //---------------------------------------------------------------------------
  34. void __fastcall TClientForm::Button3Click(TObject *Sender)
  35. {
  36. Application->Terminate();
  37. }
  38. //---------------------------------------------------------------------------