I have this class definition:
HEADER:
extern "C" {
int vcl_Connecthandle (int chan, int baud, int bits, int parity, int stops, int flowctl);
int vcl_RecvDatahandle (int chan, const int * buf, int len );
int vcl_RecvSigHandle (int chan, int signal, int sigarg);
int vcl_ResumeHandle (int chan);
}
class VCH
{
public:
VCH();
VCH (void * Hnd, int chan);
~VCH();
int hndlConnect (int chan, int baud, int bits, int parity, int stops, int flowctl);
int hndlRecvData (int chan, const int * buf, int len );
int hndlRecvSig (int chan, int signal, int sigarg);
int hndlResume (int chan);
static VCH * hTable [3];
protected:
int sCl (int chan, int baud, int bits, int parity, int stops, int flowctl);
int RcvD (int chan, const int * buf, int len );
int RcvS (int chan, int signal, int sigarg);
private:
//bool isMaster;
void * vchHnd;/* handle to an open VChanLib channel */
int vchannel;
int vclbaud;
int vclbits, vclparity, vclstops, vclflowctl, vclbrktm;
bool vclsendBreak;
int sndStat;
int vclBuffer [255];
//int ptrBuffer;
};
CPP:
#include "head.h"
extern "C" {
int vcl_Connecthandle (int chan, int baud, int bits, int parity, int stops, int flowctl);
int vcl_RecvDatahandle (int chan, const int * buf, int len );
int vcl_RecvSigHandle (int chan, int signal, int sigarg);
int vcl_ResumeHandle (int chan);
}
int vcl_Connecthandle (int chan, int baud, int bits, int parity, int stops, int flowctl)
{
VCH * vhnd = VCH::hTable[chan-1];
vhnd->sCl (chan, baud, bits, parity, stops, flowctl);
}
when I try to compile it, I get this error message:
Quote
1>c:\users\anematollahi\documents\visual studio 2010\projects\tstclass\tstclass\vch.cpp(13): error C2248: 'VCH::sCl' : cannot access protected member declared in class 'VCH'
1> c:\users\anematollahi\documents\visual studio 2010\projects\tstclass\tstclass\head.h(22) : see declaration of 'VCH::sCl'
1> c:\users\anematollahi\documents\visual studio 2010\projects\tstclass\tstclass\head.h(9) : see declaration of 'VCH'
1>
1>Build FAILED.
1> c:\users\anematollahi\documents\visual studio 2010\projects\tstclass\tstclass\head.h(22) : see declaration of 'VCH::sCl'
1> c:\users\anematollahi\documents\visual studio 2010\projects\tstclass\tstclass\head.h(9) : see declaration of 'VCH'
1>
1>Build FAILED.
Can someone help me figure out why and tell me how I can fix it please?
Thanks


Sign In
Create Account


Back to top









