I discovered a bug in SCI Studio 3.01
In the View editor I get the error "Canvas does not allow drawing", sometimes followed by the famous "Incorrect parameter" error.
This error occurs at random, so it's not easy to replicate. I'm running Win98SE.
Brian : Sorry to put this in the forum instead of e-mailing this, but I'm having email-troubles with my provider.
Heh. All the bugs are due to Win98. hehe|
Well, the good news is the traffic to my site last year was about 60% Win98, now it's about 60% WinXP. In all seriousness though, I will have them fixed when SCI Studio 3.1 is out since I'll do a lot of testing on a Win98 machine.
Make sure you test long enough. The bug I mentioned appeared after working more than an hour in the view-editor.
Yeah I used to use 98, but now I use XP. ;D|
Let's just say... I am never going back, I love XP. :)
|Wilco23||I'm currently on Win95 and I've been having the same problem as Sith, in the view editor and picture editor. It does seem to just happen at random, "Canvas does not allow drawing" and "Paramater is ". The latter comes up a million times on my screen, so I have to press Ctrl + Alt + Delete to cancel SCI Studio on the taskmanager.|
I've been doing some research myself and it seems that this bug is probably still a memory leak.|
The "canvas does not allow drawing" could indicate that you're not cleaning up all the DC's you're allocating. (as a result, Windows cannot provide you with a valid DC anymore. I think there is a limit to the number of DC's a program can allocate, but I'm not sure.)
Brian, when you go to the next cell in a loop, do you create a new DC to draw the next view or do you use one DC that's updated every time ? In the first case, are you sure you free() the DC that's not in use anymore ?
|Brian_Provinciano||None of the Canvas errors come from my WinAPI. The Canvas is a Borland VCL component that locks itself sometimes, generating the error message. I will look into whether or not I can check if the canvas is locked before writing to it, possibly waiting for it to be ready to avoid the message. Borland's VCL is crap, but coding the whole UI in WinAPI would be like coding in assembly language.|
I found a Delphi help-file on the web and since Delphi also uses the VCL I think most of it is applicable to the C++ components too.
The TCanvas class has a method called TryLock()
form the helpfile :
I hope this helps you a little bit...
One question : Do you use multi-threading in SCI Studio ? Because if you do, you must be very careful with locking and unlocking resources.
PS : here are some free memory- and resourceleak-checkers http://www.thefreecountry.com/sourcecode/debugging.shtml
I guess it is e memory leak due to missing deallocations of memory just like Sith pointed 8)|
In fact it happens in the font editor as well... to let it come out, you must display all the characters using the arrows, after having step through a pair dozen of chars you'll get the canvas error.
Also another bug happens when you change the font size, if you select the font size field bt don't change its value it is changed carelessy of your choice.
However, Brian rocks! ;)