Canvas does not allow drawing...
Posted on 2004-04-02
I'm back with more of my lack of knowledge in Delphi ;)
For those of you that remember my RAS application, well it's working very well thanks to the EE experts, although I'm having another problem:
Every now and then I get a "canvas does not allow drawing" error (this is what the Delphi debuger sends). I've done some testing and finally spotted a common place where it happens.
I don't know if this info is relevant but I'm giving it anyway in case it helps:
The error occurs when the user tries to dial the phone number under a phone-central without the - 9, - prefix to get a line. So the central returns a beeping similar to the "line bussy" and the application returns a user friendly error (coded by me) telling the line is bussy. Then the application attemps to dial again (since it's default config is to make 3 redial attempts) with the common close-line/dial-again that works like a charm when the phone number was entered correctly. When it tries to dial again, my application crashes with the "canvas does not allow drawing" error.
I read a bit and the explanations for this error that I found (lack of system resources) don't seem to apply to me. I read about a possible solution Canvas.Lock or Canvas.Trylock but I don't know where to place that.
Any ideas or suggestions are very welcome.