home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3570 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!well!johnrp
  3. From: johnrp@well.sf.ca.us (John Panzer)
  4. Subject: DLLs using cout,cin,cerr blow up
  5. Message-ID: <By0B37.403@well.sf.ca.us>
  6. Sender: news@well.sf.ca.us
  7. Organization: Whole Earth 'Lectronic Link
  8. Distribution: na
  9. Date: Fri, 20 Nov 1992 08:47:31 GMT
  10. Lines: 20
  11.  
  12.  
  13. The title just about says it all.  When I put code that uses the
  14. standard streams cout, cin, or cerr into Windows DLLs & compile
  15. with Borland, the DLL generally crashes the system upon unloading
  16. (under 3.0) or generates a mysterious fault (3.1).  It seems to
  17. be due to stack overflow (looks like a very small system stack
  18. is being used).
  19.  
  20. Why would these streams appear in a Windows program in the first
  21. place?  Well, my problem appeared in a third-party library which
  22. used cerr for critical error messages.  I didn't even know it
  23. was there until I traced through the shutdown code & saw the
  24. destructors...
  25.  
  26. The problem has been solved by getting rid of all references to cerr.
  27. Bottom line, it seems that static objects with destructors in DLLs
  28. are a Bad Idea.
  29.  
  30. John Panzer
  31. johnrp@well.sf.ca.us
  32.