Click here to Skip to main content
16,004,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: max controls on a dialog using vc++ Pin
burnafatty11-Feb-04 7:35
burnafatty11-Feb-04 7:35 
GeneralRe: max controls on a dialog using vc++ Pin
Christian Graus11-Feb-04 9:46
protectorChristian Graus11-Feb-04 9:46 
GeneralRe: max controls on a dialog using vc++ Pin
Ryan Binns10-Feb-04 17:59
Ryan Binns10-Feb-04 17:59 
GeneralThanks Pin
burnafatty11-Feb-04 7:50
burnafatty11-Feb-04 7:50 
GeneralAccessing private class members Pin
georgiek5010-Feb-04 12:54
georgiek5010-Feb-04 12:54 
GeneralRe: Accessing private class members Pin
loket10-Feb-04 13:10
loket10-Feb-04 13:10 
GeneralRe: Accessing private class members Pin
georgiek5010-Feb-04 13:24
georgiek5010-Feb-04 13:24 
GeneralRe: Accessing private class members Pin
Ian Darling10-Feb-04 13:49
Ian Darling10-Feb-04 13:49 
You do get what private means, right? It's an implementation detail that you shouldn't rely on, because somebody is guaranteed to change it the moment you start monkeying about with it.

Ignore the suggestion of #define private public (although made in jest), because that's the sort of thing that shots you in the foot later on.

You can fudge a solution by declaring an identical class/struct (with the same compiler packing options, etc!), but without the use of private. If you're lucky, the compiler will generate matching object layouts, and you can reinterpret_cast a pointer from one type to the other, and then access the private members through that.

Use of this technique is extremely brittle, and if I was your boss or peer, I'd be distinctly unimpressed with you, and make you junk that code.

Generally speaking, what you're trying to do indicates you don't understand the problem correctly, you don't understand the language properly, or you have a crap design that needs rethinking.

And if this is homework, then go back to the textbooks Smile | :)


Ian Darling
"The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski
GeneralRe: Accessing private class members Pin
georgiek5010-Feb-04 13:54
georgiek5010-Feb-04 13:54 
GeneralRe: Accessing private class members Pin
Ian Darling10-Feb-04 13:58
Ian Darling10-Feb-04 13:58 
GeneralRe: Accessing private class members Pin
John R. Shaw10-Feb-04 14:17
John R. Shaw10-Feb-04 14:17 
GeneralRe: Accessing private class members Pin
georgiek5010-Feb-04 14:58
georgiek5010-Feb-04 14:58 
GeneralVisual C++ 6 +7 Pin
Rohde10-Feb-04 12:41
Rohde10-Feb-04 12:41 
GeneralRe: Visual C++ 6 +7 Pin
Christian Graus10-Feb-04 15:52
protectorChristian Graus10-Feb-04 15:52 
GeneralRe: Visual C++ 6 +7 Pin
shultas10-Feb-04 16:11
shultas10-Feb-04 16:11 
GeneralRe: Visual C++ 6 +7 Pin
Tim Smith10-Feb-04 18:19
Tim Smith10-Feb-04 18:19 
GeneralUsing an edit box from other file. Help needed!! Pin
satcat10-Feb-04 12:30
satcat10-Feb-04 12:30 
GeneralSubclassing or Derviving Pin
monrobot1310-Feb-04 12:27
monrobot1310-Feb-04 12:27 
GeneralRe: Subclassing or Derviving Pin
John R. Shaw10-Feb-04 12:49
John R. Shaw10-Feb-04 12:49 
GeneralRe: Subclassing or Derviving Pin
mcsweeneyd10-Feb-04 15:38
mcsweeneyd10-Feb-04 15:38 
GeneralRe: Subclassing or Derviving Pin
monrobot1311-Feb-04 10:04
monrobot1311-Feb-04 10:04 
GeneralStrange memory overrun Pin
John R. Shaw10-Feb-04 10:43
John R. Shaw10-Feb-04 10:43 
GeneralRe: Strange memory overrun Pin
Tom Larsen10-Feb-04 11:30
Tom Larsen10-Feb-04 11:30 
GeneralRe: Strange memory overrun Pin
John R. Shaw10-Feb-04 12:37
John R. Shaw10-Feb-04 12:37 
GeneralRe: Strange memory overrun Pin
Tom Larsen11-Feb-04 5:00
Tom Larsen11-Feb-04 5:00 

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.