Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2007

Tip: Looking for answers? Try searching our database.

UnhandledException 0x4bc0145c Access Violation writing location 0x

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
satheeskumar - 30 May 2007 15:01 GMT
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
Oleg Starodumov - 31 May 2007 08:56 GMT
> In my project i have a component named PTS Engine which is developed in VC++
> .Net 2003. [VC 6.0]
[quoted text clipped - 4 lines]
> "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.

Signature

Oleg
[VC++ MVP http://www.debuginfo.com/]


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.