UnhandledException 0x4bc0145c Access Violation writing location 0x

G

Guest

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,adParamInput,4,value);
else
pPar = pCom->CreateParameter(_bstr_t(Name),adInteger,adParamOutput,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)bstrDescription);

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
 
O

Oleg Starodumov

satheeskumar said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top