Results 1 to 3 of 3

Thread: C++ Builder

  1. #1
    Join Date
    Dec 2008
    Posts
    29

    C++ Builder

    hi,
    i want to know how to manage the socket on C++ BuilderClient/server with TClientSocket and TServerSocket and How Manages the OnClientRead events and the method for sends text.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: C++ Builder

    One Starts with the Server application:
    To start your C++ Builder (I have the version 2007)
    To create a new “Receiving” project

    In the pallet component to add one
    TEdit
    TButton “the Caption title is Fermer”
    TServerSocket

    Double Clicks on the window

    void __fastcall TForm1:: FormCreate (TObject *Sender)

    {

    ServerSocket1->Port = 23;

    ServerSocket1->Active = True;

    }

    //--

    On the events of the mitre Objet Inspector, double clicks on the case of OnClose and put this code:


    //---------------------------------------------------------------------------

    void __fastcall TForm1:: FormClose (TObject *Sender, TCloseAction &Action)

    {

    ServerSocket1->Active = False;

    }

    //------


    On the Card (Form1) click on ServerSocket1 control


    On the events of the mitre Objet inspector, double clicks on the case of OnClientRead


    Put this code:


    void __fastcall TForm1:: ServerSocket1ClientRead (TObject *Sender,

    TCustomWinSocket *Socket)

    {

    Edit1->Clear ();

    Edit1->Text = Socket->ReceiveText ();

    }

    //-

    To record the project


    Maintaining the Customer:
    To create a new project “Waiter”
    To add TButton of the caption: Send (sent)
    To add ClientSocket
    And TEdit

    Double clicks on the window and to add this code:

    void __fastcall TForm1:: FormCreate (TObject *Sender)

    {

    ClientSocket1->Port = 23;

    ClientSocket1->Host = “Address IP HERE”;

    ClientSocket1->Active = True;

    }

    //-


    And In OnClose add this code:


    //---------------------------------------------------------------------------

    void __fastcall TForm1:: FormClose (TObject *Sender, TCloseAction &Action)

    {

    ClientSocket1->Active = False;

    }

    //-

    On the card To click twice on the short prop “Send”

    Add this code:


    void __fastcall TForm1:: Button1Click (TObject *Sender)

    {

    yew (ClientSocket1->Active)

    ClientSocket1->Socket->SendText (Edit1->Text);

    }

    //-

    Recorded the project and carried out it.

  3. #3
    Join Date
    Dec 2008
    Posts
    29

    Re: C++ Builder

    hi,
    Thank you, for instruction......

Similar Threads

  1. what is MSI Package Builder
    By Sparrow in forum Windows Software
    Replies: 3
    Last Post: 02-09-2010, 06:38 PM
  2. Need a Html web builder
    By Nipissing in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 09:28 AM
  3. Builder problem in java
    By Solaris in forum Software Development
    Replies: 3
    Last Post: 03-12-2009, 02:41 PM
  4. How to become a system builder ?
    By Beltran in forum Education Career and Job Discussions
    Replies: 3
    Last Post: 27-06-2009, 09:05 AM
  5. SQL Query Builder
    By LasitMalinga in forum Software Development
    Replies: 5
    Last Post: 29-04-2009, 03:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,504,501.27345 seconds with 17 queries