Click here to Skip to main content
13,457,409 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am destroying GraphView Window Created By Me On Clear Button,
Code Works Fine In Debug Mode But Crashes In Release Mode.
Please Help

Posted 12-Feb-13 20:16pm
Richard MacCutchan 13-Feb-13 4:51am
This needs a lot more detail; we cannot guess from the above what may be happening.
adityarao31 13-Feb-13 9:34am
If I remove these two line code works absolutely fine in release mode also
Richard MacCutchan 13-Feb-13 11:28am
Well, there's your solution.
adityarao31 13-Feb-13 13:03pm
But I require to clear graph
Richard MacCutchan 13-Feb-13 13:24pm
Well you need to provide a lot more details of what you are trying to do and what your code is doing. As it stands we cannot guess what is going on.
Binu MD 14-Feb-13 0:48am
Please give deatils like
1) clear button is placed on parent window or graph window.
2) Why are you try to destroy window instead of clearing.
3) What is your requirement clear window or destroy window.
adityarao31 14-Feb-13 2:22am
Clear button is placed on parent button in ehich above code is written.
Requirement of application is to remove total graphview on clear button.
Is there any function like clearwindow?
adityarao31 14-Feb-13 3:25am
Actually i got the problem.In my code some times I require to delete graph,but that tine graph is not existing so I kept condition OF IsWindow,but it seems is window crashes
I dont know how to fix problem? or I have to keep track by boolean variable like
IsGraphExist. Is there any other way I can know If graph view exist.
Binu MD 14-Feb-13 3:37am
You can use Invalidate() or FillRect() functions to clear the graph.
Binu MD 14-Feb-13 3:39am
One more thing

Confirm that IsWindow() is called from the thread, that created the GraphView.
adityarao31 14-Feb-13 3:45am
Thank you very much for your time and effort

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

My Problem got solved by using IsBadReadPtr Function.I thanks to every one who tried to solve the problem

CPallini 14-Feb-13 4:34am
You may find interesting this documentation page:
Richard MacCutchan 14-Feb-13 4:59am
If you just want to clear the client area of the Window, then you should set a flag, or clear all the data of the graph, then use InvalidateWindow(). Then in your paint function you should check if a graph exists and do nothing if there is no data. That will automatically clear the graph from the window.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180322.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100