Title: Message
No I'm using the debug dll in a debug build.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 4:24 PM
To: [EMAIL PROTECTED]
Subject: RE: memory corruption when deleting the SAXParser

Are you using the Debug DLL in release project?  We have seen similar errors before when we accidentally have run against a debug library in release project or the other way around.
 
Ravin
-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 12:49 PM
To: '[EMAIL PROTECTED]'
Subject: RE: memory corruption when deleting the SAXParser

If it's the one about changing the project settings to use Multithreaded DLL settings - yes.  Is that the one?
-----Original Message-----
From: Jesse Pelton [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 2:21 PM
To: '[EMAIL PROTECTED]'
Subject: RE: memory corruption when deleting the SAXParser

Have you read the FAQ about mixing MS runtimes? It may be relevant.
-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 2:14 PM
To: '[EMAIL PROTECTED]'
Subject: RE: memory corruption when deleting the SAXParser

Good point, but the problem still occurs even after changing.
 
I tried commenting out all of the code in the second try section and moving the delete command right after the SAXParser obect is created, and it still give the memory corruption error.  Could it be as simple as changing a setting in the dev enviroment?
-----Original Message-----
From: Adam Heinz [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 1:49 PM
To: [EMAIL PROTECTED]
Subject: RE: memory corruption when deleting the SAXParser

I don't think this is the cause of your corruption, but there's no reason to call path.GetBuffer()/ReleaseBuffer().  By default, the CString can be cast to a LPCTSTR (and should do so by default), so just call parser->parse(path).

Adam Heinz
Senior Software Developer
Exstream Software

-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 1:38 PM
To: XML4C List ([EMAIL PROTECTED])
Subject: memory corruption when deleting the SAXParser

 
I am developing in VC++6.0 with the latest service pack and using xerces-c_1_6_0D.dll.  I'm having a problem with memory corruption when I try to delete the parser object.  Any ideas?  Thanks.
 
try
 {
  XMLPlatformUtils::Initialize();
 }
 catch (const XMLException& er)
 {
  AfxMessageBox(CString(er.getMessage()));
  return 0;
 }
 SAXParser* parser = new SAXParser;
  
 try
 {
  parser->setValidationScheme(SAXParser::Val_Never);
  CSaxHandlers handler("");
  PaxarSAXErrorHandler error;
  parser->setDocumentHandler(&handler);
  parser->setErrorHandler(&error);
  parser->parse(path.GetBuffer(0));
  path.ReleaseBuffer(0);
  delete parser;
 }
 catch(const SAXException& de)
 {
  delete parser;  
  XMLPlatformUtils::Terminate();
  AfxMessageBox(CString(de.getMessage()));
  return 0;
 }
 catch(const XMLException& e)
 {
  delete parser;
  XMLPlatformUtils::Terminate();
  AfxMessageBox(CString(e.getMessage()));
  return 0;
 }
 
 XMLPlatformUtils::Terminate();

Reply via email to