CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Posts
    317

    localhost socket control

    Hi All,

    In a VC6 dialog based application, i want to add a local host listening socket control. The purpose is that whenever the listening socket will receive a data say "XYZ" from localhost, then it will run a function that is presently written in the button-click event handler of a Button on the dialog box.

    Can anyone provide some sample code for this socket control?

    Any help would be highly appreciated.

    -naim1

  2. #2
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: localhost socket control

    Are you sure you don't mean VB6? Things are not control based in C.

    What you need is to take a look at CSocket and CListen if you are using MFC, and socket(), connect(), and listen() if you are not. There is sample code with those functions that explain how to listen for incoming socket data.

    -Erik

  3. #3
    Join Date
    Jan 2005
    Posts
    317

    Re: localhost socket control

    Quote Originally Posted by egawtry View Post
    Are you sure you don't mean VB6? Things are not control based in C.

    What you need is to take a look at CSocket and CListen if you are using MFC, and socket(), connect(), and listen() if you are not. There is sample code with those functions that explain how to listen for incoming socket data.

    -Erik
    Yes, its VC6 for sure, although i dont know quite well how its goes in VC6. The only thing is that n event has to be generated when a specific data string say "XYZ" is received.

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: localhost socket control

    Quote Originally Posted by naim1 View Post
    Yes, its VC6 for sure, although i dont know quite well how its goes in VC6.
    So you're trying to write a C++ application using sockets, and you don't know C++?

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured