Name look up compilation error

S

siddhu

dear experts,

I have put my class in a namesapce. in implementing the method it
calls some methods implented in .h file.
In that .h file it calls some other methods.
Following is the content of .h file included in my source code

#ifdef GetNextWindow
#undef GetNextWindow
AFX_INLINE HWND GetNextWindow(HWND hWnd, UINT nDirection)
{ return ::GetWindow(hWnd, nDirection); }
#endif

I am getting following error in VC7.

Error 3 error C2039: 'GetWindow' : is not a member of '`global
namespace'' c:\program files\microsoft visual studio 8\vc\atlmfc
\include\afxv_w32.h 236

If I remove my class from namespace (i.e. my class definitions are not
in my namespace but in global namespace) same thing is getting
compiled. But i want it to put in my namespace.
Any suggestion would be of great help.

Thanks
Siddharth
 
V

Victor Bazarov

siddhu said:
I have put my class in a namesapce. in implementing the method it
calls some methods implented in .h file.

OK. It would be better to read C++ instead of English, but OK.
In that .h file it calls some other methods.

"It"? Who is "it"?
Following is the content of .h file included in my source code

#ifdef GetNextWindow
#undef GetNextWindow
AFX_INLINE HWND GetNextWindow(HWND hWnd, UINT nDirection)
{ return ::GetWindow(hWnd, nDirection); }
#endif

I am getting following error in VC7.

Error 3 error C2039: 'GetWindow' : is not a member of '`global
namespace'' c:\program files\microsoft visual studio 8\vc\atlmfc
\include\afxv_w32.h 236

If 'GetWindow' is not in the global namespace, where is it?
If I remove my class from namespace (i.e. my class definitions are not
in my namespace but in global namespace) same thing is getting
compiled. But i want it to put in my namespace.

You keep telling about your class. But the problem is that it
can't see 'GetWindow'. What's 'GetWindow'?
Any suggestion would be of great help.

Post complete minimal code that exhibits the problem you're asking
about.

V
 
P

Paavo Helde

Error 3 error C2039: 'GetWindow' : is not a member of '`global
namespace'' c:\program files\microsoft visual studio 8\vc\atlmfc
\include\afxv_w32.h 236

Your description of the problem is everything but clear. However my magic
ball tells me you are including some headers from inside your namespace.
This is a big no-no, an #include line should never be inside a namespace!

HTH
Paavo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top