12

Could you please let me know what is difference between DECLARE_DYNAMIC and DECLARE_DYNCREATE?

Where exactly we can use them?

Tomalak
  • 332,285
  • 67
  • 532
  • 628
Hara
  • 1,467
  • 4
  • 18
  • 35
  • Possible duplicate of [Why should i use DECLARE\_DYNAMIC instead of DECLARE\_DYNCREATE?](https://stackoverflow.com/questions/27879680/why-should-i-use-declare-dynamic-instead-of-declare-dyncreate) – IInspectable Sep 28 '17 at 12:49
  • @IInspectable, this question was asked in year 2009, and you are marking the question which is asked in year 2015. I would recommend you to do in reverse order. mark your latest question as duplicate of this very old question. – Hara Sep 28 '17 at 12:54
  • The term duplicate has no notion of time. The fact that a question that was asked later turned this question into a duplicate doesn't make this question any less of a duplicate. I marked this as a duplicate of another question, because that other question is more to the point, and offers a more detailed explanation. Marking a question as a duplicate helps future visitors to see, that there is another Q&A that's largely identical, but may provide more information. It is not meant as a tool to communicate the order of historic events. – IInspectable Sep 28 '17 at 13:07
  • See [How should duplicate questions be handled?](https://meta.stackexchange.com/q/10841/205381) Specifically: *"The general rule is to **keep the question with the best collection of answers**, and close the other one as a duplicate."* – IInspectable Sep 28 '17 at 13:10

1 Answers1

15

The first declares that a class has runtime type info and the second that instances can be created dynamically at runtime. This is described in detail in the MSDN documentation - see links like Run-Time Object Model Services for more info.

IInspectable
  • 46,945
  • 8
  • 85
  • 181
  • 2
    Also note that if you use `DECLARE_DYNCREATE` in the header file, you must be certain to match this with `IMPLEMENT_DYNCREATE` in the source file. (Ditto for the others.) – Dan Nissenbaum Jun 19 '16 at 20:05