From: Chetan on
I have a MFC window, i have added a date time picker to it. I added a
class say CGen to it, derived from the class CDialog, which in turn
derived from CWnd.

Now i want to customize date ctrl, by overriding CDateTimeCtrl which
is derived from CWnd Class..
For that i created new class say CDte, which will be derived from
CDateTimeCtrl.

I am trying to use CDte member in CGen class, so that i can override
and ctrl on date time picker.
But Complier is showing error, that "error C2065: 'm_ctrlDateFormat' :
undeclared identifier".

Even though both are derived from the same base class, CWnd.. i am
unable to overcome this problem.
Please if any one could help me to solve this problem..

Thanks in advance..
Chetan.






From: Victor on
Why do you think you do need a class "derived from CDateTimeCtrl"?
What is 'm_ctrlDateFormat' which was, according to your compiler message
"undeclared"?

Victor

"Chetan" wrote:

> I have a MFC window, i have added a date time picker to it. I added a
> class say CGen to it, derived from the class CDialog, which in turn
> derived from CWnd.
>
> Now i want to customize date ctrl, by overriding CDateTimeCtrl which
> is derived from CWnd Class..
> For that i created new class say CDte, which will be derived from
> CDateTimeCtrl.
>
> I am trying to use CDte member in CGen class, so that i can override
> and ctrl on date time picker.
> But Complier is showing error, that "error C2065: 'm_ctrlDateFormat' :
> undeclared identifier".
>
> Even though both are derived from the same base class, CWnd.. i am
> unable to overcome this problem.
> Please if any one could help me to solve this problem..
>
> Thanks in advance..
> Chetan.
>
>
>
>
>
>
>
From: Joseph M. Newcomer on
See below...
On Mon, 28 Jul 2008 00:27:50 -0700 (PDT), Chetan <sbchetan(a)gmail.com> wrote:

>I have a MFC window, i have added a date time picker to it. I added a
>class say CGen to it, derived from the class CDialog, which in turn
>derived from CWnd.
>
>Now i want to customize date ctrl, by overriding CDateTimeCtrl which
>is derived from CWnd Class..
>For that i created new class say CDte, which will be derived from
>CDateTimeCtrl.
>
>I am trying to use CDte member in CGen class, so that i can override
>and ctrl on date time picker.
>But Complier is showing error, that "error C2065: 'm_ctrlDateFormat' :
>undeclared identifier".
****
(a) showing us an error message without the source line is meaningless
(b) if the line was
CDte m_ctrlDateFormat
then it is necessary to add, to the header file in which this declaration appears, the
#include for the header file that defines
class CDte : public CDateTimeCtrl
or you will get this error

Nobody cares what the base class is, or that they have the same base class. All that
matters is that the class is defined at the point where the declaration occurs.
joe
>
>Even though both are derived from the same base class, CWnd.. i am
>unable to overcome this problem.
>Please if any one could help me to solve this problem..
>
>Thanks in advance..
>Chetan.
>
>
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm