Click here to Skip to main content
15,903,523 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: old fashioned memory access in a visual C++ console application? Pin
Erik Juhl27-Feb-03 9:22
Erik Juhl27-Feb-03 9:22 
GeneralRe: old fashioned memory access in a visual C++ console application? Pin
codedancer27-Feb-03 9:34
codedancer27-Feb-03 9:34 
GeneralRe: old fashioned memory access in a visual C++ console application? Pin
Gary R. Wheeler1-Mar-03 2:48
Gary R. Wheeler1-Mar-03 2:48 
GeneralRe: old fashioned memory access in a visual C++ console application? Pin
Anonymous1-Mar-03 10:01
Anonymous1-Mar-03 10:01 
GeneralRe: old fashioned memory access in a visual C++ console application? Pin
Gary R. Wheeler1-Mar-03 14:20
Gary R. Wheeler1-Mar-03 14:20 
AnswerRe: old fashioned memory access in a visual C++ console application? Pin
dim136-Jan-05 2:05
dim136-Jan-05 2:05 
GeneralImPLEMENT_DYNAMIC Pin
ns27-Feb-03 7:54
ns27-Feb-03 7:54 
GeneralRe: ImPLEMENT_DYNAMIC Pin
Dave Bryant27-Feb-03 8:24
Dave Bryant27-Feb-03 8:24 
Using any of the DECLARE_* macros creates a CRuntimeClass object for each of those classes, which can be accessed by the RUNTIME_CLASS macro. This allows RTTI, using the IsKindOf() method on CObject. If you use the DECLARE_DYNCREATE or DECLARE_SERIAL macros, then this also allows dynamic creation of an object, from the CRuntimeClass. This is used within MFC when creating views - you pass in the CRuntimeClass* of the view you want to create, and then MFC calls the CreateObject() method to actually instantiate the view.

The different macros do the following:

DECLARE_DYNAMIC - Creates a CRuntimeClass object for each class using this macro, which allows RTTI via the IsKindOf() method on CObject. Of course, C++ RTTI does this anyway.

DECLARE_DYNCREATE - Does DECLARE_DYNAMIC, but also allows dynamic creation by calling the CreateObject() method on the CRuntimeClass.

DECLARE_SERIAL - Does DECLARE_DYNCREATE, but with added support for MFC serialization.

Generally, I use DECLARE_DYNAMIC on most of my CObject derived classes, and DECLARE_DYNCREATE on all of my views.

Dave
Generalthanks! Pin
ns27-Feb-03 8:32
ns27-Feb-03 8:32 
GeneralEfficient use of memory and filtering Pin
Anton A. Loukine27-Feb-03 6:41
Anton A. Loukine27-Feb-03 6:41 
GeneralRe: Efficient use of memory and filtering Pin
John M. Drescher27-Feb-03 6:50
John M. Drescher27-Feb-03 6:50 
GeneralRe: Efficient use of memory and filtering Pin
Anton A. Loukine27-Feb-03 7:20
Anton A. Loukine27-Feb-03 7:20 
GeneralRe: Efficient use of memory and filtering Pin
Daniel Turini27-Feb-03 7:34
Daniel Turini27-Feb-03 7:34 
GeneralRe: Efficient use of memory and filtering Pin
John M. Drescher27-Feb-03 7:48
John M. Drescher27-Feb-03 7:48 
QuestionAutomatic generation of MS Visual C++ projects ? Pin
CHARMAN27-Feb-03 6:19
CHARMAN27-Feb-03 6:19 
AnswerRe: Automatic generation of MS Visual C++ projects ? Pin
AlexO27-Feb-03 8:21
AlexO27-Feb-03 8:21 
GeneralSHGetFileInfo: I can't get SHGFI_ICONLOCATION to work Pin
Mike Morearty27-Feb-03 6:15
Mike Morearty27-Feb-03 6:15 
GeneralRe: SHGetFileInfo: I can't get SHGFI_ICONLOCATION to work Pin
AlexO27-Feb-03 8:38
AlexO27-Feb-03 8:38 
GeneralRe: SHGetFileInfo: I can't get SHGFI_ICONLOCATION to work Pin
Mike Morearty27-Feb-03 8:49
Mike Morearty27-Feb-03 8:49 
GeneralCSliderCtrl notifications Pin
Maximilien27-Feb-03 5:25
Maximilien27-Feb-03 5:25 
GeneralRe: CSliderCtrl notifications Pin
AlexO27-Feb-03 5:59
AlexO27-Feb-03 5:59 
Generalmultiple windowed apps Pin
SumGuy27-Feb-03 5:19
SumGuy27-Feb-03 5:19 
GeneralRe: multiple windowed apps Pin
Rage27-Feb-03 5:55
professionalRage27-Feb-03 5:55 
GeneralRe: multiple windowed apps Pin
SumGuy27-Feb-03 6:26
SumGuy27-Feb-03 6:26 
GeneralI figured it out thanks Pin
SumGuy27-Feb-03 7:19
SumGuy27-Feb-03 7:19 

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.