CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Posts
    16

    Help me using winsock in Windows forms...

    Hi everybody. I'm new in this forum and also in VC++. In a windows form project, i'll transmit a text data by winsock. I did this in console, but i don't know how to do this in form application. For example, where should i define my objects and functions. As i know In Form.h , i can't define a new class, so how this will be possible? And which libs i have to use? Please help me about this, cause all examples i've read tells me about winsock in console applications...

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: Help me using winsock in Windows forms...

    Quote Originally Posted by Noreturn
    As i know In Form.h , i can't define a new class, so how this will be possible?
    Are you sure about that? AFAIK there is no limitation on how many classes you can declare in a header-file. Anyway, if you don't want to do that you can simply add you own header file.

    Quote Originally Posted by Noreturn
    And which libs i have to use?
    Depends on the function you use. You can find lots of documentation on msdn.microsoft.com.

    Quote Originally Posted by Noreturn
    I did this in console, but i don't know how to do this in form application.
    Only difference is that you don't want to use blocking socket calls in the main/GUI thread, that would make you application appear to have 'freezed'. You should take a look at WSAAsyncSelect or WSAEventSelect.

    - petter

  3. #3
    Join Date
    Dec 2006
    Posts
    16

    Re: Help me using winsock in Windows forms...

    Thanks for ur help wildfrog, i'll try ur comments. But i think i'll deal with using this functions under my GUI. Anyway. I must learn too many things...

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