473,508 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate a MFC 'CDialog' handle

3 New Member
I have a handle to MFC 'CDialog' and i need to check if handle valid (maybe dialog already destroyed) befor i used it (for example _myDld->ttt->IsWindowVisible() ) how can i validate this?
Aug 6 '07 #1
1 3006
weaknessforcats
9,208 Recognized Expert Moderator Expert
Most likely you will have created an object using the new operator.

Maybe:

Expand|Select|Wrap|Line Numbers
  1. MyDialogBox* ptr;
  2.  ptr = new MyDialogBox;
  3.  
If so, as long as ptr is not zero you can assume the dialog box is still in existence.

I recommend using handles for this instead of pointers. There is an article in the C/C++ Articels section about handle classes.
Aug 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2599
by: Pagaia | last post by:
Hello to all, is there someone who know how create/paint a Cdialog with no standard borders? I'm looking for some tips because i want create a visual program with a personal skin. Thanks for...
3
2352
by: iceColdFire | last post by:
HI, I am trying to build a simple MFC Application using MSVC 6.0 I require two CDialog windows, simultaneously. The scenario is like two windows receiving each other messages.. The problem is...
6
2150
by: Abby Lee | last post by:
I must confirm the user enters a value for each fund they need. I do not know how many fund entries there will be...it's expandable to handle each users needs. I must varify each fund they enter is...
3
5946
by: Martin | last post by:
Hi, I am implemeting a form in asp.net. The form is quite large and the validation is reasonably complex, so I have decieded to implement my own validation rather than use any custon...
3
5418
by: Jennifer | last post by:
Hi, Is there anyone to have idea how to make the MFC CDialog box display Unicode (like Chinese characters) in .NET 2005? We have some dilog boxes created from CDialog class in VC++ 6.0 and try...
0
1673
by: InNeedOfHelp | last post by:
Hi, In MFC is it possible to get the document from a class derived from CDialog? I know that you can call getDocument() from the View class but is there function that will do the same from a Dialog...
11
11732
by: jjbutera | last post by:
I know how to use the ErrorProvider in my winforms..or do I? I validate the values and set the ErrorProvider in the validating event. If not valid, I set e.Cancel = True. I clear the ErrorProvider...
0
1327
by: vut.wong | last post by:
Hi, I would like to get use my activex control inside Cdialog in beginthreadex When I used Cdialog and activex control , everything is fine but when i put it inside thread (beginthreadex),...
4
1567
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi How can I declare a CDialog object as a member of a managed class? As the following is not working: RbfPropDlg* rbfDlg; Where RbfPropDlg is the CDialog class.
0
7229
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
7129
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
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3208
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
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.