Who can help me about 'undeclared identifier' error message! 
Author Message
 Who can help me about 'undeclared identifier' error message!

Hi,
I am newbie for VC++,I met a error message when compile the project.

my code:

mainapp.h:
  ....
 CMDIChildWnd *m_wnd[48];
  ....

maindoc.cpp:
#include "mainapp.h"
....
    app->m_wnd[i]->SetWindowPos(&wndTopMost,1040,0,768,768,SWP_NOZORDER);
....

when compile this program,It give me the
D:\maindoc.cpp(106) : error C2065: 'wndTopMost' : undeclared identifier
I know the  'wndTopMost'is the cwnd special value,I included the #include
<afxwin.h> in my cpp
But system allways prompt the error message,why
Who can help me! any help will be appreciate.

thanks



Fri, 05 Dec 2003 12:49:39 GMT  
 Who can help me about 'undeclared identifier' error message!
I'm not sure if this will help but I'll try.

I have never heard of wndTopMost, though I don't do too
much playing around with different windows.

However, this might work.....

Look into the function  "GetTopWindow"  

Cwd * a = GetTopWindow();
app->m_wnd[i]->SetWindowPos(
a->GetSafeHwnd() ,1040,0,768,768,SWP_NOZORDER);

Not sure if that works or if that is even what you are
trying to do but maybe gives you something to go off of

Quote:
>-----Original Message-----
>Hi,
>I am newbie for VC++,I met a error message when compile
the project.

>my code:

>mainapp.h:
>  ....
> CMDIChildWnd *m_wnd[48];
>  ....

>maindoc.cpp:
>#include "mainapp.h"
>.....
>    app->m_wnd[i]->SetWindowPos

(&wndTopMost,1040,0,768,768,SWP_NOZORDER);
Quote:
>.....

>when compile this program,It give me the
>D:\maindoc.cpp(106) : error C2065: 'wndTopMost' :

undeclared identifier
Quote:
>I know the  'wndTopMost'is the cwnd special value,I

included the #include

- Show quoted text -

Quote:
><afxwin.h> in my cpp
>But system allways prompt the error message,why
>Who can help me! any help will be appreciate.

>thanks

>.



Mon, 08 Dec 2003 21:54:42 GMT  
 Who can help me about 'undeclared identifier' error message!
Try this
app->m_wnd[i]->SetWindowPos(&CWnd::wndTopMost,1040,0,768,768,SWP_NOZORDER);

Note that wndTopMost is a static member of the CWnd class, so you have
to refer it with the class name.



Tue, 09 Dec 2003 18:36:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. error C2065: 'sqrt': undeclared identifier

2. error C2065: 'DIID__IMessangerEvents' : undeclared identifier

3. error C2065: '_com_dispatch_method' : undeclared identifier

4. error C2065: 'sprintf' : undeclared identifier

5. 'Undeclared identifier' error

6. error C2065: 'HANDLE' : undeclared identifier

7. error C2065: 'AfxMessageBox' : undeclared identifier

8. error C2065: 'HW_PROFILE_INFO' : undeclared identifier

9. error C2065: 'm_templateList' : undeclared identifier

10. error C2065: 'CSTR_EQUAL' : undeclared identifier

11. error C2065: 'AfxMessageBox' : undeclared identifier

12. error C2065: 'pMyView' : undeclared identifier

 

 
Powered by phpBB® Forum Software