home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4243 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.7 KB  |  47 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!usc!cs.utexas.edu!wotan.compaq.com!twisto.eng.hou.compaq.com!sword.eng.hou.compaq.com!mccreary
  3. From: mccreary@sword.eng.hou.compaq.com (Ed McCreary)
  4. Subject: C++ problem with BC++ 3.1
  5. Message-ID: <1992Dec8.203056.29165@twisto.eng.hou.compaq.com>
  6. Sender: news@twisto.eng.hou.compaq.com (Netnews Account)
  7. Organization: Compaq Computer Corp.
  8. Date: Tue, 8 Dec 1992 20:30:56 GMT
  9. Lines: 36
  10.  
  11. Hmmm, I've got a rather bizzare problem which I can't seem to figure 
  12. out.  I'm writing a MDI program with OWL which holds an image in
  13. the MDI children.  Each child window is derived from TWindow.
  14.  
  15. Now before I create the child window, I run a parsing function to
  16. extract information for the image file header.  I need buffers to
  17. manipulate the header, so I did the following:
  18.  
  19.     char* buffer = new char[80];
  20.     ...code for parsing...
  21.     delete [] buffer;
  22.  
  23. When I use this code, I get a GPF in kernel.exe at the end of the child
  24. window constructor.  Remember, the parsing code is executed before the
  25. child is created and is even in a different module.  Also, this
  26. error does not occur every time.  Sometimes, Windows will lock instead
  27. of giving a GPF, but this is rare.
  28.  
  29. The problem disappears completely when I declare:
  30.  
  31.     char    buffer[80];
  32.  
  33. instead at the top of the parsing function.  
  34.  
  35. I'd rather allocate the buffers dynamically, but I can't figure
  36. out why this fails.  I'm new to C++ so maybe there's something I'm
  37. missing.
  38.  
  39. Sigh, any ideas or helpful hints are appreciated.
  40.  
  41.  
  42.  
  43. --
  44. Ed McCreary                                               ,__o
  45. mccreary@sword.eng.hou.compaq.com                       _-\_<,
  46. "If it were not for laughter, there would be no Tao."  (*)/'(*)
  47.