C++ Managed and unmanaged code with std library

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Ive written a managed DLL that Im calling from unmanaged code that is a win32 application and uses the std library. The DLL functions correctly. I.e., the functions that the DLL performs all work correctly. The code compiles with no warnings
or errors and runs correctly. However, when debugging, if I use
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); and _CrtDumpMemoryLeaks(); to check for memory leaks, I always get detected memory leaks. This only occurs when I use the std library. Im using <string>, <list>, <fstream>,
and <iostream>. If I remove the std library calls I get no memory leaks.
Does anyone know if this is an issue with Visual C++ or is this my issue? Im running Visual Studio 2010 SP1. Heres the VS 2010 About box information.
Microsoft Visual Studio 2010<br/>
Version 10.0.40219.1 SP1Rel<br/>
Microsoft .NET Framework<br/>
Version 4.0.30319 SP1Rel<br/>
<br/>
Installed Version: Professional<br/>
<br/>
Microsoft Office Developer Tools xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Office Developer Tools<br/>
<br/>
Microsoft Visual Basic 2010 xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual Basic 2010<br/>
<br/>
Microsoft Visual C# 2010 xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual C# 2010<br/>
<br/>
Microsoft Visual C++ 2010 xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual C++ 2010<br/>
<br/>
Microsoft Visual F# 2010 xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual F# 2010<br/>
<br/>
Microsoft Visual Studio 2010 Team Explorer xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual Studio 2010 Team Explorer<br/>
<br/>
Microsoft Visual Web Developer 2010 xxxxx-xxx-xxxxxxx-xxxxx<br/>
Microsoft Visual Web Developer 2010<br/>
<br/>
Crystal Reports Templates for Microsoft Visual Studio 2010 <br/>
Crystal Reports Templates for Microsoft Visual Studio 2010<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2522890) KB2522890<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2522890.<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2529927) KB2529927<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2529927.<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2542054) KB2542054<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2542054.<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2548139) KB2548139<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2548139.<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2549864) KB2549864<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2549864.<br/>
<br/>
Hotfix for Microsoft Visual Studio 2010 Professional - ENU (KB2635973) KB2635973<br/>
This hotfix is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this hotfix will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2635973.<br/>
<br/>
Microsoft Visual Studio 2010 Professional - ENU Service Pack 1 (KB983509) KB983509<br/>
This service pack is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this service pack will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/983509.<br/>
<br/>
Microsoft Visual Studio 2010 SharePoint Developer Tools 10.0.40219<br/>
Microsoft Visual Studio 2010 SharePoint Developer Tools<br/>
<br/>
Security Update for Microsoft Visual Studio 2010 Professional - ENU (KB2645410) KB2645410<br/>
This security update is for Microsoft Visual Studio 2010 Professional - ENU.<br/>
If you later install a more recent service pack, this security update will be uninstalled automatically.<br/>
For more information, visit http://support.microsoft.com/kb/2645410.<br/>
<br/>
XtraReports package 1.0<br/>
XtraReports package

Thanks in advance.
- Neil Shore


View the full article
 
Back
Top