IMPLEMENT_DYNAMIC, DECLARE_DYNAMIC problem
-
Today I spent around 2 hours to fix a problem. I have created a new Dialog class derived from CDailog. When my code was on half way my PL told me that, you can use a dialog class which is available from a library (I'm not mentioning the name) which will do some basic look and feel for your dialog. I suddenly incorporated the new .h file, lib and DLL files with my projects to use that library. After that my dialog class is not compiling at any cost. It's stopping by pointing error in IMPLEMENT_DYNAMIC macro call in my CPP file. The error was "classMyDlg" not a memeber of MyDlg class. First I doubted my code, the I thought that it's the problem with macro definition because the base class defined inside a name space which is contained by another namespace. I doubted the parameterized constructor ( but fortunately it was acting as a default one because of the default value to the parameters) I just removed that IMPLENT_DYNAMIC macro from CPP file and DECLARE_DYNAMIC from my .h file then I compiled. I was consoling myself that my Dialog class is not used for any Runtime identification purpose. I just went through the class declaration of the base class. WTF. It's missing the DECLARE_DYNAMIC declaration. I just confirmed by adding the DECLARE_DYNAMIC in it's header file. Yes! it compiling (not linking) I sent a mail to my PL to ask the responsible person to fix the problem and I'm happy now even that ***code*** wasted my 2-3 hours
-Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern