CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    92

    creating classes

    int CKanComm::ConnectKanPort()
    {
    //m_hConnectionSettings = CString("COM1: baud=9600 parity=N data=8 stop=1");
    LPCTSTR lsettings = "COM1: baud=9600 parity=N data=8 stop=1";
    DCB m_hCommObject;


    if ( !BuildCommDCB(lsettings, &m_hCommObject) )
    {
    TRACE0("Communication object was not created");
    return -1;
    }
    CKanComm::m_hCommObjectSettings = m_hCommObject;
    CKanComm::m_hConnectionSettings = (CString)lsettings;
    return 0;
    }

    I have written the above code, but when I try to set to variables that I have in the class header I get the message:KanComm.cpp(44) : error C2597: 'CKanComm::m_hConnectionSettings' : does not specify an object


    What am I doing wrong and what causes this problem




  2. #2
    Guest

    Re: creating classes

    Try using the form of assignment you commented out near the top of your code.


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