Solved

Debug Assertion Failed: dbgdel.cpp Line: 52  _BLOCK_TYPE_IS_VALID

Posted on 2004-04-22
2
3,414 Views
Last Modified: 2013-11-20
The text in subject is that which is shown in a debug assertion error message box displayed when the m_pConn->Open(...) method below is called. When this line of code is executed, I am converting a CString variable (connectionString) to a _bstr_t. The full text of the error message is "Debug Assertion Failed! dbgdel.cpp Line: 52 _BLOCK_TYPE_IS_VALID".  Can anyone shed light on this?  This code was previously working.  I must have changed something, but I don't know what.  Please note, I am reading some entries for the ADO connection string from registry entries and populating these entries in my program as CString variables.  

_bstr_t tablesNames;
_ConnectionPtr m_pConn;
m_pConn.CreateInstance (__uuidof(Connection));
CString connectionString;
if (usingAccess_1)
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " + accessDBPath2;
else
connectionString = "Provider=SQLOLEDB;Data Source=" + mvwin32SQLsrvName + ",1433;Network Library=DBMSSOCN;Initial Catalog=" + mvwin32SQLsrvDB + ";" + "Trusted_Connection=Yes;";

m_pConn->Open( _bstr_t( connectionString ), _bstr_t( "" ), _bstr_t( "" ), adConnectUnspecified );

-dotBomb
0
Comment
Question by:dotBomb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 10889064
Make sure that all components in your project are set to "Use Runtime Library: Multithreaded DLL".
0
 

Author Comment

by:dotBomb
ID: 10889597
jkr,

You are exactly correct, and in fact, I remember changing this, erroneously I see.
To summarize, in my MFC project properties in the .NET IDE, under "Code Generation" the "Runtime Library" should be set to "Multi-threaded Debug DLL (/MDd)" in Debug mode and "Multi-threaded DLL (/MD)" in Release mode.  I sure hope this helps someone.  It helped me immensely!

-dotBomb
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question