473,385 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

UnhandledException 0x4bc0145c Access Violation writing location 0x

In my project i have a component named PTS Engine which is developed in VC++
..Net 2003. [VC 6.0]
And it is migrated to VC++.NET 2005 version. Initially this migration
process has coded and tested in VC++ .NET 2005 Beta version. In beta version
everything is working fine. When i tryied to run in .NET 2005 full version i
am facing the following access violation Error.
"Unhandled exception at 0x4bc0145c in Engine.exe: 0xc0000005: Access
Violation writing location 0xccccccc"

The Details of the Error.
This is the code where i am calling the CreateParameter method.
/************************************************** *****
* Function to add a LONG parameter to a stored procedure (Overloading)
************************************************** ****/

void CDatabase::AddParam(CString Name, long value,BOOL IsInType)
{
//Long
try
{
_ParameterPtr pPar;
if ( IsInType )
pPar = pCom->CreateParameter(_bstr_t(Name),adInteger,adParamIn put,4,value);
else
pPar = pCom->CreateParameter(_bstr_t(Name),adInteger,adParamOu tput,4,value);
pCom->Parameters->Append(pPar);

}

catch(_com_error & e)

{

_bstr_t bstrSource(e.Source());

_bstr_t bstrDescription(e.Description());

logprintf("\nSPName: %s \nCDatabase::AddParam() \nParamName: %s \nSource :
%s \nDescription : %s
\n",m_strSPName,Name,(LPCSTR)bstrSource,(LPCSTR)bs trDescription);

CUtility::Mailer("Exception in CDatabase::AddParam(CString Name, long value,
BOOL IsInType)"); //Passed Value instead of HeaderID

throw "error";

}

catch(...)

{

CUtility::Mailer("Exception in CDatabase::AddParam(CString Name, long value,
BOOL IsInType)"); //Passed Value instead of HeaderID
logprintf("Exception CDatabase::AddParam");
}
}
/*************************************************/
The CreateParameter function is the place where i have this exception.
Similar functions are present in Database.CPP. These functions are used in
various parts of the code.
i am using the following DLL = "C:\Program Files\Common
Files\System\ADO\msado15.dll"
This application is a multi threaded console application

I need support on this:
1.How can we resolve this Access violation error
2.Whether we can use the ADO.NET to call the CreateParameter function in
..Net 2005

May 30 '07 #1
1 13865

"satheeskumar" <sa**********@discussions.microsoft.comwrote in message
news:A5**********************************@microsof t.com...
In my project i have a component named PTS Engine which is developed in VC++
.Net 2003. [VC 6.0]
And it is migrated to VC++.NET 2005 version. Initially this migration
process has coded and tested in VC++ .NET 2005 Beta version. In beta version
everything is working fine. When i tryied to run in .NET 2005 full version i
am facing the following access violation Error.
"Unhandled exception at 0x4bc0145c in Engine.exe: 0xc0000005: Access
Violation writing location 0xccccccc"
0xcccccccc is the pattern usually used to fill uninitialized local variables.
When you break into debugger after the exception, take a look at the values
of variables used by the code, find the one whose value is 0xcccccccc, and
check it for possibly missing initialization.

--
Oleg
[VC++ MVP http://www.debuginfo.com/]
May 31 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Steven Reddie | last post by:
I understand that access violations aren't part of the standard C++ exception handling support. On Windows, a particular MSVC compiler option enables Microsoft's Structured Exception Handling...
4
by: Thom Little | last post by:
I have a simple C# Winforms application that has an UnhandledException handler that writes to the log. This works fine if I throw a new exception (like"bogus") but it does not gain control on a...
0
by: Microsoft News | last post by:
I'm getting the following error when I shut down my C# .NET v1.1 application: 0xC0000005: Access violation reading location 0x73bc0000 This error didn't occur until I added a...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
1
by: Nasser | last post by:
Hello, I am coding a mathematical model with VC++. When I debug the code, I face with no erroe, but during executing, I face with below error "Unhandled exception at 0x0040c275 in Tar.exe:...
4
by: Groundskeeper | last post by:
I can't seem to get a custom UnhandledException handler working for a Windows Service I'm writing in VB.NET. I've read the MSDN and tried various different placements of the AddHandler call, to no...
1
by: Yanping Zhang | last post by:
Here are more details about my codes, please help! The function declared in C: typedef void (WINAPI *PLEARNCALLBACKPROC) (unsigned int progress, unsigned int sigQuality, unsigned long...
13
by: ycinar | last post by:
A quick question: Why doesn't the following code catch the Access violation reading location exception? it crashes on line if ( xyz ) with an Access violation reading location exception. Is not...
3
by: Pinux | last post by:
Hi, I am writing a multi-threads encryption application. The idea of the code is to create a number of threads to encrypt files. I have a thread pool say the maximum threads is 10. If the number...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.