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

    Question Is it OK to derive my class from CWinThread AND Csocket ?

    I need to combine functionality of CWinThread AND CSocket in my class, so I want to derive it from these classes… My friend tells me that its not a good idea to derive your class from more than one MFC classes, especially if one of them is a thread.
    Please let me know what you think !!!

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  3. #3
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    CAsyncSocket is derived from CObject so you are going to have
    problems
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  4. #4
    Join Date
    Jan 2000
    Posts
    129
    I see... I guess i'll have to rethink this design.

    Thanks a lot for your help!

  5. #5
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    I don't know a lot about CSocket but based on what I read it is better not to use it.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

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