473,473 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GetAncestor not a member of CWnd

D F
I have just installed VS .NET moving from VS6 and if I create an MFC
Application (Dialog) and insert the following code in the OnInitialize
method

this->GetAncestor(GA_PARENT);

I get the error message "GetAncestor() : not a member of...".

Additionally if I use ::GetAncestor it says GetAncestor is not a member of
the global namespace. And if I just use GetAncestor is can not find that
method.....

Methods like ::GetWindowText work fine!

Any ideas?

Thanks

D.
Nov 17 '05 #1
3 2067
"D F" <df@x.z> wrote in message news:4v********************@is.co.za...
I have just installed VS .NET moving from VS6 and if I create an MFC
Application (Dialog) and insert the following code in the OnInitialize
method

this->GetAncestor(GA_PARENT);

I get the error message "GetAncestor() : not a member of...".

Additionally if I use ::GetAncestor it says GetAncestor is not a member of
the global namespace. And if I just use GetAncestor is can not find that
method.....

Methods like ::GetWindowText work fine!

Any ideas?


Both the declaration and implementation of GetAncestor are wrapped inside an
#if (WINVER >= 0x0500) conditional.
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #2
D F
BINGO....and thank you....

Ok so I change the WINVER to 0x0500 and it compiles....but why doesn't
0x0400 work? According to the docs it has been in for 98 and NT4

<PASTE>
Windows NT/2000/XP: Included in Windows NT 4.0 SP4 and later.
Windows 95/98/Me: Included in Windows 98 and later.
</PASTE>

and WINVER = 0x0400 and other variables are set correctly for 98 and NT?

Any ideas?

Regards

Daniel.
"Jeff Partch [MVP]" <je***@mvps.org> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
"D F" <df@x.z> wrote in message news:4v********************@is.co.za...
I have just installed VS .NET moving from VS6 and if I create an MFC
Application (Dialog) and insert the following code in the OnInitialize
method

this->GetAncestor(GA_PARENT);

I get the error message "GetAncestor() : not a member of...".

Additionally if I use ::GetAncestor it says GetAncestor is not a member of the global namespace. And if I just use GetAncestor is can not find that
method.....

Methods like ::GetWindowText work fine!

Any ideas?
Both the declaration and implementation of GetAncestor are wrapped inside

an #if (WINVER >= 0x0500) conditional.
--
Jeff Partch [VC++ MVP]

Nov 17 '05 #3
"D F" <df@x.y.com> wrote in message news:Jv********************@is.co.za...
BINGO....and thank you....

Ok so I change the WINVER to 0x0500 and it compiles....but why doesn't
0x0400 work? According to the docs it has been in for 98 and NT4

<PASTE>
Windows NT/2000/XP: Included in Windows NT 4.0 SP4 and later.
Windows 95/98/Me: Included in Windows 98 and later.
</PASTE>

and WINVER = 0x0400 and other variables are set correctly for 98 and NT?

Any ideas?


No, I can't say if it makes sense. It doesn't seem to match the WINVER
settings list to me either, but it does match the declaration in the SDK
WinUser.h.
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wenjie | last post by:
Hello, I read someone posted assertions that even the (public) member function is not static, there are probably only one copy of the code in the executable. Then except the...
0
by: Doug Goodhew | last post by:
In the header file of a class Derived from a CWnd class I have imported the OCX. #import "msvbvm60.dll" rename("RGB", "myRGB") rename("EOF","myEOF") #import "GSEgrids.ocx" And created a...
0
by: Robert Hanson | last post by:
Hi All, In an application's COM API, I can get the CWnd handle and I need some guidance on how to place either controls directly or place a child window with the additional controls on it...
2
by: Sam Riggens | last post by:
I am experimenting with C# and trying to use an unmanaged C++ dll. The UMC++ dll has a function defined as follows: extern "C" bool DllExport ShowLogonDlg(CWnd *pParent, CConfig& cfg); The...
1
by: Girish | last post by:
I was wondering if anybody has the implementation of CWnd::RunModalLoop/ CWnd::EndModalLoop in C# Mine is a single threaded application... what I want is, the application to wait at one point...
0
by: Robert Hanson | last post by:
Hi All, In an application's API, I can get the CWnd handle and I need some guidance on how to place either controls directly or place a child window with the additional controls on it?? If I...
2
by: Eitan | last post by:
Hello, I am creating a new window class based on CWnd. I am placing it on the View (CFormView). How can I get the notification or any other indication that the cursor/mouse is not on this...
0
by: Eitan | last post by:
Hello, I am creating a new window class based on CWnd. I am placing it on the View (CFormView). How can I get the notification or any other indication that the cursor/mouse is not on this...
1
by: lauch2 | last post by:
After performing the following steps, what happen to my application or the system: 1. My application has a class, namely CMyWnd, which is inherited from CWnd. 2. Instantiate a CMyWnd object by:...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.