🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13471

crash on F12

#13471
From: M. Finch
Date: Thu, 09 Oct 2003 22:19
44 lines
2526 bytes
I have an interesting problem that I can't seem to resolve.

I'm using CBuilder 5 (Standard Edition) to code using standard Petzold style
C.  I am doing some graphics, essentially drawing a radar scope and small
circles and lines representing geographic points in the area.

I am trying to develop a zoom feature so that you can press F11 to zoom in
and F12 to zoom out.  The amount of zoom is set in an integer named mag.
Here is the WM_KEYDOWN code.  I also have a debug file opened so I can keep
track of variables etc.

       case WM_KEYDOWN:
          switch(wParam)
          {
            case VK_F11:
              mag--;
              fprintf(debug,"Keydown %d/n",mag);
              GetClientRect(hWnd, &rect);
              InvalidateRect(hWnd, &rect, true);
            break;
            case VK_F12:
              mag--;
              fprintf(debug,"Keydown %d/n",mag);
              GetClientRect(hWnd, &rect);
              InvalidateRect(hWnd, &rect, true);
            break;

          }
        break;

What happens, is the no matter the value of mag, or anyother reason that I
know of, when I press F12 my program crashes and I get the Borland Debug,
registers, etc.  There is no error shown, just a window labeled CPU and all
of the registers, etc.

When I press F11, it works fine.....I've checked the Microsoft web site to
see if this is the recommended practice, and it appears it is.

I have tried this in another program and get the SAME result....crash with
VK_F12.

Any ideas???

Thanks in Advance!!
Technical Details
Message-ID: <3f85ded2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2fad7e4d444a1c65,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-09 15:24:34 PST
Reply-To: "M. Finch" <mlfsup@nospam.comcast.net>
From: "M. Finch" <mlfsup@nospam.comcast.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: crash on F12
Date: Thu, 9 Oct 2003 17:19:07 -0500
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 68.51.77.211
Message-ID: <3f85ded2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065737938 68.51.77.211 (9 Oct 2003 15:18:58 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail