Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » PromptOKCancel error;
PromptOKCancel error; [message #19639] Fri, 26 December 2008 16:53 Go to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

I Have this error:
Quote:


Exception: C0000005 at 00478D9A
EXCEPTION_ACCESS_VIOLATION
reading at 00000036


after when I use Function PromptOKCancel on win32 compiled with MSC8 DEBUG.
I thing that the error is in:
int Prompt(Callback1<const String&> WhenLink,
           const char *title, const Image& iconbmp, const char *qtf, bool okcancel,
           const char *button1, const char *button2, const char *button3,
		   int cx,
		   Image im1, Image im2, Image im3)
...
Vector<Ctrl *> wins = Ctrl::GetTopWindows();
	for(int i = 0; i < wins.GetCount(); i++) {
		TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
!!!!		if(w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
			dlg.TopMost();
			break;
		}
	}

becouse it cannot "w->GetScreenRect()"... may be the property "Rect16 rect;" of class Ctrl(object w) is not initialized becouse it used "TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);"?

I attached the package where i get this error!
try to close application and error is prompt!
Help please!

[Updated on: Sat, 27 December 2008 13:01]

Report message to a moderator

Re: PromptOKCancel error; [message #19653 is a reply to message #19639] Mon, 29 December 2008 16:07 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

I tested to compile and run on ubuntu 8.10. this error I have not!
Error is only on win32 (windows xp).
Re: PromptOKCancel error; [message #19664 is a reply to message #19653] Thu, 01 January 2009 19:23 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Intersting. The problem is that GetTopWindows doesn't filter out your TrayIcon, so the dynamic_cast fails and returns NULL.

TrayIcon is unique in that it is the only Ctrl that I know of that has a top-level window but is neither a TopWindow or a PopUp.

Re: PromptOKCancel error; [message #19674 is a reply to message #19639] Sun, 04 January 2009 14:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Fixed:

		TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
		if(w && w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
			dlg.TopMost();
			break;
		}


Mirek
Re: PromptOKCancel error; [message #19702 is a reply to message #19674] Tue, 06 January 2009 11:48 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Sun, 04 January 2009 15:59

Fixed:

		TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
		if(w && w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
			dlg.TopMost();
			break;
		}


Mirek

Thanks!
Previous Topic: TopWindows WhenMinimize event
Next Topic: TopWindow not closed on Escape
Goto Forum:
  


Current Time: Thu Mar 28 14:19:46 CET 2024

Total time taken to generate the page: 0.01551 seconds