Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. help in csocket code plzzzz

help in csocket code plzzzz

Scheduled Pinned Locked Moved Managed C++/CLI
c++comhelptutorialquestion
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imran_rafique
    wrote on last edited by
    #1

    SIR, I dont know how to use csocket class in managed code. any bode can help me. plz read this code clearly and namespace mfcdll { class CListeningSocket : public CSocket { public: CListeningSocket(){} virtual ~CListeningSocket(void){} //{{AFX_VIRTUAL(CListeningSocket) public: virtual void OnAccept(int nErrorCode); //}}AFX_VIRTUAL // Generated message map functions //{{AFX_MSG(CListeningSocket) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG }; //*********************************************** public __gc class M_listeningsocket { public: M_listeningsocket(); ~M_listeningsocket(void); CListeningSocket *ptr3; //{{AFX_VIRTUAL(M_listeningsocket) public: virtual void OnAccept(int nErrorCode); //}}AFX_VIRTUAL void Create(UINT port); bool Listen(void); }; } //******************************************************** ///file name (m_listeningsocket.cpp) M_listeningsocket::M_listeningsocket() { ptr3=new CListeningSocket( ); } M_listeningsocket::~M_listeningsocket(void) { delete ptr3; } void mfcdll::M_listeningsocket::OnAccept(int nErrorCode) { ptr3->OnAccept(nErrorCode); } void mfcdll::M_listeningsocket::Create(UINT port) { if(ptr3->Create(port)) MessageBox(0,"create succ....",0,0); else MessageBox(0,"create not succge....",0,0); } bool mfcdll::M_listeningsocket::Listen(void) { if(ptr3->Listen()) { MessageBox(0,"Listen succ....",0,0); return true; } else { MessageBox(0,"Listen not succ....",0,0); return false; } } //******************************************************** if(ptr3->Create(port)) i dont know why it return false in above line what is mistake in the above code can any body tell me i will be very thank full to u. r00d0034@yahoo.com

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups