Click to See Complete Forum and Search --> : creating classes


delbert Harry
April 15th, 1999, 03:23 PM
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

April 15th, 1999, 03:45 PM
Try using the form of assignment you commented out near the top of your code.