Thread View: comp.os.ms-windows.programmer.misc
4 messages
4 total messages
Started by Arto Oinas
Sat, 23 Jan 1993 15:09
Does anybody know this bug?
Author: Arto Oinas
Date: Sat, 23 Jan 1993 15:09
Date: Sat, 23 Jan 1993 15:09
13 lines
1105 bytes
1105 bytes
I am programming an application with Turbo C++ for Windows 3.0. I use Windows version 3.0. So far, I've detected all bugs and fixed them. Now one lurking bug is driving me mad, I have no idea about it's causes. Well, I know that this is too general, but here is what the bug does: Sometimes after running the application Windows gives me an Unrecoverable Application error when I toggle the mouse on text editing window (in Turbo C++) and start typing something. However (of course) this doesn't happen al- ways. So if you have seen this problem and solved it, please answer? Arto Oinas - first year Computer Science student from Finland (Too general really I bet)
Re: Does anybody know this bug?
Author: Chris Marriott
Date: Sat, 23 Jan 1993 17:33
Date: Sat, 23 Jan 1993 17:33
35 lines
2137 bytes
2137 bytes
In article <1993Jan23.150923.12794@ousrvr.oulu.fi> artoinas@phoenix.oulu.fi writes: > >I am programming an application with Turbo C++ for Windows 3.0. I use Windows >version 3.0. So far, I've detected all bugs and fixed them. Now one lurking >bug is driving me mad, I have no idea about it's causes. > >Well, I know that this is too general, but here is what the bug does: >Sometimes after running the application Windows gives me an Unrecoverable >Application error when I toggle the mouse on text editing window (in Turbo >C++) and start typing something. However (of course) this doesn't happen al- >ways. So if you have seen this problem and solved it, please answer? > >Arto Oinas - first year Computer Science student from Finland >(Too general really I bet) > > I suggest you try and run your application under Windows 3.1, if at all possible. That way the UAE will be replaced by a General Protection Fault, which has the advantage of showing you *where* your program crashed. Armed with that address and a linker map you can then find out which function the problem is occurring in, and track it down from there. Best wishes, Chris -- -------------------------------------------------------------------------- | Chris Marriott | chris@chrism.demon.co.uk | | Warrington, UK | BIX: cmarriott | | | CIX: cmarriott | | Save the whales. Collect the whole set. | CompuServe: 100113,1140 | --------------------------------------------------------------------------
Re: Does anybody know this bug?
Author: S H Bowman
Date: Tue, 26 Jan 1993 12:52
Date: Tue, 26 Jan 1993 12:52
25 lines
1453 bytes
1453 bytes
artoinas@phoenix.oulu.fi (Arto Oinas) writes: >I am programming an application with Turbo C++ for Windows 3.0. I use Windows >version 3.0. So far, I've detected all bugs and fixed them. Now one lurking >bug is driving me mad, I have no idea about it's causes. >Well, I know that this is too general, but here is what the bug does: >Sometimes after running the application Windows gives me an Unrecoverable >Application error when I toggle the mouse on text editing window (in Turbo >C++) and start typing something. However (of course) this doesn't happen al- >ways. So if you have seen this problem and solved it, please answer? >Arto Oinas - first year Computer Science student from Finland >(Too general really I bet) This is a pretty general problem so try this general answer: Check your hdc and hwnd parameters in functions like EndPaint. I have mixed these up on numerous occasions and it has given exactly the type of fault you describe, sometimes taking hours to sort out! I can't understand why the STRICT compilation doesn't spot this. Simon
Re: Does anybody know this bug?
Author: John Grant
Date: Wed, 27 Jan 1993 02:28
Date: Wed, 27 Jan 1993 02:28
49 lines
2352 bytes
2352 bytes
In article <C1Gp35.9Ez@sunlab1.bath.ac.uk> mssshb@sunlab1.bath.ac.uk (S H Bowman) writes:
>artoinas@phoenix.oulu.fi (Arto Oinas) writes:
>
[...stuff about some bug deleted...]
>This is a pretty general problem so try this general answer:
>
>Check your hdc and hwnd parameters in functions like EndPaint.
>
>I have mixed these up on numerous occasions and it has given exactly
>the type of fault you describe, sometimes taking hours to sort out!
>I can't understand why the STRICT compilation doesn't spot this.
This is obvious, but it's worth a check - does your
#define STRICT appear *before* #include <windows.h>???
Well EndPaint doesn't have an HDC, but ReleaseDC has both
HWND & HDC. I just stuck the following in my code somewhere:
{HWND hwnd;
HDC hdc;
ReleaseDC(hdc,hwnd); //this is WRONG
}
and BC++ 3.1 gives me two "suspicious pointer conversion"
errors (also the obvious warning that hdc & hwnd are used
before being defined). If I switch it around:
ReleaseDC(hwnd,hdc); //this is RIGHT
then I don't get those 2 pointer warnings.
It looks like STRICT is working for me, but then again I
have *every* single warning message turned on and I don't
go any further until they have all been fixed. I can't
stress this enough for all of you programmers out there.
My app is 22k lines of code and I don't get a single warning
message when I do a full build (with all warnings turned on).
I only used #pragma argsused in a couple of places where I
have some unused function parameters in place (for future
expansion). Everything is fully prototyped and as bugtight
as I could make it, and I *still* get the odd bug or two
(as expected).
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
--
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads