Click here to Skip to main content
15,925,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionNamed Pipes buffer problem (Win32) Pin
vga28-Sep-06 2:53
vga28-Sep-06 2:53 
AnswerRe: Named Pipes buffer problem (Win32) Pin
Richard Andrew x648-Sep-06 19:48
professionalRichard Andrew x648-Sep-06 19:48 
GeneralRe: Named Pipes buffer problem (Win32) Pin
vga210-Sep-06 22:36
vga210-Sep-06 22:36 
QuestionRPC Authentication won't work Pin
Mr.Brainley8-Sep-06 2:13
Mr.Brainley8-Sep-06 2:13 
AnswerRe: RPC Authentication won't work Pin
Programm3r8-Sep-06 2:20
Programm3r8-Sep-06 2:20 
GeneralRe: RPC Authentication won't work Pin
Mr.Brainley8-Sep-06 2:39
Mr.Brainley8-Sep-06 2:39 
GeneralRe: RPC Authentication won't work Pin
Programm3r8-Sep-06 2:43
Programm3r8-Sep-06 2:43 
Questionerror C2248: cannot access protected member declared in class 'CEmployee' Pin
jon-808-Sep-06 1:51
professionaljon-808-Sep-06 1:51 
Why can't the derived class access protected members from its base class?

#include <iostream>

using namespace std;

class CEmployee
{
protected:
float m_HourlyRate;
float m_HoursWorked;
};

// class CEmployee //forward declaration
class CAccountant : protected CEmployee
{
public:
void CalcSalary(CEmployee &emp)
{
emp.m_HourlyRate = 50;
emp.m_HoursWorked = 1;
};
};


void main ()
{
CAccountant joe;

}

Error:
Test.cpp(17): error C2248: cannot access protected member declared in class 'CEmployee'

Also, in the code above I was trying to use a forward declaration so that I could declare CEmployee after CAccountant, but the following compilation error was displayed:
error C2504: 'CEmployee' : base class undefined

Does this mean that forward declarations cannot be done on classes that might need to be inherited?





Jon
AnswerRe: error C2248: cannot access protected member declared in class 'CEmployee' Pin
prasad_som8-Sep-06 2:04
prasad_som8-Sep-06 2:04 
AnswerRe: error C2248: cannot access protected member declared in class 'CEmployee' Pin
David Crow8-Sep-06 3:18
David Crow8-Sep-06 3:18 
AnswerRe: error C2248: cannot access protected member declared in class 'CEmployee' Pin
Zac Howland8-Sep-06 4:12
Zac Howland8-Sep-06 4:12 
QuestionShow character from number? [modified] Pin
bosfan8-Sep-06 1:39
bosfan8-Sep-06 1:39 
QuestionRe: Show character from number? [modified] Pin
prasad_som8-Sep-06 2:15
prasad_som8-Sep-06 2:15 
AnswerRe: Show character from number? Pin
bosfan8-Sep-06 3:53
bosfan8-Sep-06 3:53 
GeneralRe: Show character from number? Pin
prasad_som8-Sep-06 5:34
prasad_som8-Sep-06 5:34 
Questioncheckbox selection Pin
_tasleem8-Sep-06 1:05
_tasleem8-Sep-06 1:05 
AnswerRe: checkbox selection Pin
Hamid_RT8-Sep-06 1:11
Hamid_RT8-Sep-06 1:11 
GeneralRe: checkbox selection Pin
_tasleem8-Sep-06 1:28
_tasleem8-Sep-06 1:28 
AnswerRe: checkbox selection Pin
Rinu_Raj8-Sep-06 1:16
Rinu_Raj8-Sep-06 1:16 
QuestionRe: checkbox selection Pin
David Crow8-Sep-06 3:13
David Crow8-Sep-06 3:13 
QuestionFinding deleted virtual keywords Pin
manustone8-Sep-06 0:56
manustone8-Sep-06 0:56 
AnswerRe: Finding deleted virtual keywords Pin
Steen Krogsgaard8-Sep-06 3:51
Steen Krogsgaard8-Sep-06 3:51 
QuestionAdding buttons in title bar Pin
pc_dev8-Sep-06 0:54
pc_dev8-Sep-06 0:54 
AnswerRe: Adding buttons in title bar Pin
Hamid_RT8-Sep-06 1:08
Hamid_RT8-Sep-06 1:08 
GeneralRe: Adding buttons in title bar Pin
pc_dev8-Sep-06 1:49
pc_dev8-Sep-06 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.