home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1819 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.2 KB  |  35 lines

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!sdd.hp.com!uakari.primate.wisc.edu!tik.vtt.fi!aku
  2. From: aku@tik.vtt.fi (Arto Kujala)
  3. Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
  4. Subject: Destructor problem in a DLL
  5. Message-ID: <BuKIps.Cps@tik.vtt.fi>
  6. Date: 14 Sep 92 12:29:51 GMT
  7. Sender: aku@tik.vtt.fi (Arto Kujala)
  8. Organization: Technical Research Centre of Finland, Laboratory for Information Processing (VTT/TIK)
  9. Lines: 24
  10.  
  11. I am programming a windows DLL with Borland C++, OWL and Classlibs.
  12. The DLL is used from a VB application. When closing the DLL, there is
  13. the following problem:
  14.  
  15. I have a class, that can not use its own data in its own destructor
  16. without a runtime error ("An error has occured..." and sometimes 
  17. a General Protection Fault). 
  18.  
  19. For example, this class (Drawings) has a private
  20. variable xSize:
  21.  
  22. class Drawings {
  23. private:
  24.     int xSize;
  25. ...
  26.  
  27. If I try to copy xSize (int theSize = xSize) in destructor of Drawings,
  28.  a "An error has occured..." dialog box is given. All other variables
  29. of the class seem to be in same state.
  30.  
  31. What could be wrong in my code? I noticed
  32. that WEP is called before the destructor (my WEP does nothing).
  33.  
  34. --Arto
  35.