Click here to Skip to main content
15,797,960 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: pthread Pin
Jun Du12-Jul-06 6:08
Jun Du12-Jul-06 6:08 
Questionoverzealous protection rules Pin
Dave Schumann12-Jul-06 5:53
Dave Schumann12-Jul-06 5:53 
AnswerRe: overzealous protection rules Pin
toxcct12-Jul-06 5:56
toxcct12-Jul-06 5:56 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:02
Dave Schumann12-Jul-06 6:02 
AnswerRe: overzealous protection rules Pin
Dave Kerr12-Jul-06 5:59
Dave Kerr12-Jul-06 5:59 
GeneralRe: overzealous protection rules Pin
Christian Graus12-Jul-06 6:00
protectorChristian Graus12-Jul-06 6:00 
GeneralRe: overzealous protection rules Pin
toxcct12-Jul-06 6:05
toxcct12-Jul-06 6:05 
GeneralRe: overzealous protection rules Pin
Dave Kerr12-Jul-06 6:08
Dave Kerr12-Jul-06 6:08 
Internally yes a class is a struct with a vftbl.

Regardless, this does solve the problem. Changing the structs to classes does not, neither does explicitly declaring partner as public.

More explicit casting :

void foobar()
{ ((::A*)this)->partner->value += 2; }

or

void foobar()
{ ((A*)this)->partner->value += 2; }

as mentioned in the notes for Compiler Error C2248 on MSDN doesn't work either. It's rather an odd one.

Dave Kerr
codechamber@hotmail.com
http://www.codechamber.com
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:29
Dave Schumann12-Jul-06 6:29 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:04
Dave Schumann12-Jul-06 6:04 
AnswerRe: overzealous protection rules Pin
Maximilien12-Jul-06 5:59
Maximilien12-Jul-06 5:59 
AnswerRe: overzealous protection rules Pin
David Crow12-Jul-06 6:10
David Crow12-Jul-06 6:10 
GeneralRe: overzealous protection rules Pin
toxcct12-Jul-06 6:06
toxcct12-Jul-06 6:06 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:17
Dave Schumann12-Jul-06 6:17 
GeneralRe: overzealous protection rules Pin
David Crow12-Jul-06 6:27
David Crow12-Jul-06 6:27 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:33
Dave Schumann12-Jul-06 6:33 
GeneralRe: overzealous protection rules Pin
Zac Howland12-Jul-06 6:50
Zac Howland12-Jul-06 6:50 
GeneralRe: overzealous protection rules Pin
toxcct12-Jul-06 7:38
toxcct12-Jul-06 7:38 
GeneralRe: overzealous protection rules Pin
Zac Howland12-Jul-06 8:05
Zac Howland12-Jul-06 8:05 
QuestionRe: overzealous protection rules Pin
David Crow12-Jul-06 7:30
David Crow12-Jul-06 7:30 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 6:07
Dave Schumann12-Jul-06 6:07 
GeneralRe: overzealous protection rules Pin
Zac Howland12-Jul-06 7:09
Zac Howland12-Jul-06 7:09 
GeneralRe: overzealous protection rules Pin
Dave Schumann12-Jul-06 7:15
Dave Schumann12-Jul-06 7:15 
GeneralRe: overzealous protection rules Pin
Zac Howland12-Jul-06 7:25
Zac Howland12-Jul-06 7:25 
GeneralRe: overzealous protection rules [modified] Pin
Dave Schumann12-Jul-06 7:48
Dave Schumann12-Jul-06 7:48 

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.