Click here to Skip to main content
14,920,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! I am looking for some help with run-time errors in C++ application converted to 64-bit. It worked fine in 32-bit for almost a decade. I compiled it using Visual Studio 2010 64-bit compiler. There are no compiler errors. The project compiles into a dll file, which is used by an executable (.exe) application also compiled in 64-bit.

The first problem I encountered was passing a parameter to Oracle PL/SQL procedure. After debugging the problem I learned that the value I am passing to Oracle has a null character at the end. I am using a CString variable in C++, which I am passing to the PL/SQL procedure. I removed the null character within the SQL code for now, but I understand that this is nor a long-term solution. Did anyone else experience this problem converting a C++ application from 32 to 64 bit?

My second problem has to do with a run-time error. The application crashes after I read a row from a database table. The error is "Unhandled exception at 0x5c95176e (mfc100d.dll) in App.exe: 0xC0000005: Acces violation reading location 0Xfffffffffffffff8." The code that throws the error is actually not my code. It is code in the active template library. The file name is atlsimpstr.h. It is trying to release a string before coming back to the beginning of the while loop. The assert in the code below fails:
void Release() throw()
ATLASSERT( nRefs != 0 );

if( _AtlInterlockedDecrement( &nRefs ) <= 0 )
pStringMgr->Free( this );
I would appreciate any suggestions at this point. Thanks.
Richard MacCutchan 5-May-14 12:46pm
You need to use the call stack to trace where the last call out to the library was made from your code. Somewhere in there is probably the source of the error; check all parameter variables, pointers etc.
[no name] 5-May-14 13:35pm

1 solution

The second problem was resolved by declaring the two strings as global variables at the beginning of the function. For some strange reason, I can only start the app in Debug mode and not the Release executable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900