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 » RichText,QTF,RTF... » Fatal error appear every time when use SetQTF
icon8.gif  Fatal error appear every time when use SetQTF [message #36622] Thu, 21 June 2012 14:42 Go to next message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
	for(;;) 
	{
	//	GuiLock __;
		if(Thread::IsShutdownThreads())
			break;
		
		String last = view.GetQTF();
		String now = last + "&[8 [@4 show the qtf string ] ]";
		view.SetQTF(now);
		view.ScrollEnd();
		
		Sleep(20);
	
	}


I use above thread to set the richtextview,but the fatal error
appear every time when i lauch it! Please tell me whoat`s wrong.
Re: Fatal error appear every time when use SetQTF [message #36623 is a reply to message #36622] Thu, 21 June 2012 17:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, first of all, commenting out // GuiLock is wrong.

I guess you might have done this because it seemed to be frozen - it would be no wonder as GuiLock, as written, would cover Sleep call, leaving virtually no chance for main thread to run...

First of all, try:

	for(;;) 
	{
                {
		GuiLock __;
		if(Thread::IsShutdownThreads())
			break;
		
		String last = view.GetQTF();
		String now = last + "&[8 [@4 show the qtf string ] ]";
		view.SetQTF(now);
		view.ScrollEnd();
		}
		Sleep(20);
	
	}

[Updated on: Thu, 21 June 2012 17:07]

Report message to a moderator

Re: Fatal error appear every time when use SetQTF [message #36625 is a reply to message #36622] Thu, 21 June 2012 17:18 Go to previous messageGo to next message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
er...but if i uncomment the GuiLock__, the program will be very slowly!!!!
Re: Fatal error appear every time when use SetQTF [message #36630 is a reply to message #36625] Thu, 21 June 2012 20:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
akebee wrote on Thu, 21 June 2012 11:18

er...but if i uncomment the GuiLock__, the program will be very slowly!!!!


Have you tried with putting that Sleep out of block?

Do you understand an explanation why it was slow?

Mirek
Re: Fatal error appear every time when use SetQTF [message #36632 is a reply to message #36630] Thu, 21 June 2012 23:36 Go to previous message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
mirek,i finally aware of you add the brackets before the Sleep,
		      	{
					GuiLock __;
					if(Thread::IsShutdownThreads())
						break;
					
					String last = view.GetQTF();
					String now = last + "&[8 [@4 show the qtf string ] ]";
					view.SetQTF(now);
					view.ScrollEnd();
				}
				Sleep(20);


so the ~GuiLock() have changce to run......and it works well this time. Smile

[Updated on: Fri, 22 June 2012 00:00]

Report message to a moderator

Previous Topic: Printing in Windows - selecting 2 copies, prints 4 copies
Next Topic: I really don`t know how to UPDATE the RichText,help!!
Goto Forum:
  


Current Time: Wed Apr 24 03:30:21 CEST 2024

Total time taken to generate the page: 0.01972 seconds