ofstream memory problems



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/08/2004 at 14:28, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.207 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hey
    I'm developing a plugin which logs the information and values generated during an animation in a separate plain text file using the fsteam.h C++ Header File. It writes to the output file properly during the animation, but when Cinema 4D is closed, it comes up with the Application Error:
    The instruction at "0x007f5199" referenced memory at "0xfdfdfe09". The memory could not be "read". Click on OK to terminate the program.
    The only methods of the ofstream class I used were the constructor, open(), IsRunning(), the << operator, and close(). This error also occurs even if the plugin wasn't executed. Any ideas on what's wrong? Thanks a lot!
    Daniel



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/08/2004 at 01:12, xxxxxxxx wrote:

    My guess is that the ofstream library has some static variables. These can conflict with the C4D memory management, unless you define __WINCRTINIT flag in the settings for the API project. Please search forum for more information.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/08/2004 at 07:37, xxxxxxxx wrote:

    I found that the error occured when the destructor was called, so the problem can be fixed if the ofstream is declared as a pointer

        
        
          
        ofstream *ofile = new ofstream();  
        
    

    This doesn't seems to have any problems
    Thanks for your help!


Log in to reply