Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
A couple of things I noticed:

- Shouldn't the compiler complain that definition for CTestClass2 is not terminated by a ; ?

- In general its bad mojo to put #ifdefs in the middle of a class definition. Change your compiler directives and you have a class with the same name but different addresses. You'll get random memory access violations with this type of object.

In fact the second thing is what is going on. The first example you only enable the directive when you compile just that file. In essence, what you defined and what you compiled don't match and hence the memory violation. Any other file that includes this will believe the object is defined the wrong way. The second one is "foolproof" since any inclusion will enable the directive.

As I said, its bad mojo to have precompiler directives in the middle of your definition. You really should avoid it to avoid problems just like this.
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 
QuestionHow to adding "Start parameters" to a Window service Pin
sysmatrix10-Feb-04 10:09
sysmatrix10-Feb-04 10:09 
AnswerRe: How to adding "Start parameters" to a Window service Pin
Peter Weyzen10-Feb-04 11:31
Peter Weyzen10-Feb-04 11:31 
GeneralDoubts with sorting stl vector... Pin
Cloaca10-Feb-04 9:32
Cloaca10-Feb-04 9:32 
GeneralRe: Doubts with sorting stl vector... Pin
David Crow10-Feb-04 10:05
David Crow10-Feb-04 10:05 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca10-Feb-04 10:14
Cloaca10-Feb-04 10:14 
GeneralRe: Doubts with sorting stl vector... Pin
David Crow10-Feb-04 10:34
David Crow10-Feb-04 10:34 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca11-Feb-04 6:48
Cloaca11-Feb-04 6:48 
GeneralRe: Doubts with sorting stl vector... Pin
valikac10-Feb-04 10:07
valikac10-Feb-04 10:07 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca10-Feb-04 10:18
Cloaca10-Feb-04 10:18 
GeneralRe: Doubts with sorting stl vector... Pin
jhwurmbach11-Feb-04 1:51
jhwurmbach11-Feb-04 1:51 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca11-Feb-04 6:57
Cloaca11-Feb-04 6:57 
GeneralRe: Doubts with sorting stl vector... Pin
antlers11-Feb-04 11:37
antlers11-Feb-04 11:37 
GeneralRe: Doubts with sorting stl vector... Pin
Cloaca12-Feb-04 4:22
Cloaca12-Feb-04 4:22 
Generalfatal crash on win98 & winMe, Need help. Pin
haritadala10-Feb-04 7:43
haritadala10-Feb-04 7:43 
GeneralRe: fatal crash on win98 & winMe, Need help. Pin
David Crow10-Feb-04 7:49
David Crow10-Feb-04 7: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.