Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Buzz1982

DECLARE_DYNCREATE?(MFC question)

This topic is 5364 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, What does DECLARE_DYNCREATE() macro does in MFC. Not using this macro also does the job then why it is used. If their is some particular use or advantage of using it ,then please tell me what it is. thanx a lot

Share this post


Link to post
Share on other sites
Advertisement
DECLARE_DYNCREATE enables a class to work with MFC''s type information system and registers the class with CRuntimeObject::Create(), which enables the runtime to create the class from a string. This essentially enable a class to work with MFC''s factory methods. The classic examples of classes that should use DECLARE_DYNCREATE are document, view and frame classes. MFC uses string information when, for example, loading files to determine which kind of classes to create. Thus the need for DECLARE_DYNCREATE. Most other classes you either don''t need to create via CRuntimeObject, so you should leave it off, or you need serialization support for, so you should use DECLARE_SERIAL instead.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!