Hi all,
Does VS.net catches more run time errors than VS 6.0???
My aplication was written in VC++6.0 MFC which I am opening in VC.NET2003
and compiling it. It works fine when I run compile it in VS6.0 but when I
compile it in VS.net 2003 it crashes during run time (debug mode) in file
dbgrpt.c at this function:
#undef _CrtDbgBreak
_CRTIMP void _cdecl _CrtDbgBreak(
void
)
{
DebugBreak();
}
which, I don't know what this is supposed to mean :-|
This seems totally unrelated to the place it crahes in when I step thru it:
Then, it crahes at the following place in the function
DegMinSec_To_DegDecimal (a function to return 12.33 for 12:20 for eg )
Can anyone point me to any error I might be making in the the calling
function? And also why this only happens in .NET????
Thanks a lot in advance
Srishti Wilhelm
{
POSITION pos = DashaListCtrl_1->GetFirstSelectedItemPosition();
int year, month, day; double hour;
int nItem = DashaListCtrl_1->GetNextSelectedItem(pos);
CString b = DashaListCtrl_1->GetItemText( nItem, 1 );
CString a;
if( Date_format==1 )
_stscanf( b, _T("%02ld/%02ld/%04ld %s"), &month, &day, &year, a );
else
_stscanf( b, _T("%02ld/%02ld/%04ld %s"), &day, &month, &year, a );
hour = DegMinSec_To_DegDecimal(a);
}
double DegMinSec_To_DegDecimal( CString DegMinSec )
{
int sign=1;
if( DegMinSec.Find(_T("-"))!=-1 )
sign=-1;
double Degrees = _ttoi(DegMinSec);
Degrees = abs( (int)Degrees );
int i = DegMinSec.FindOneOf(_T("EWNSewns:. "));
if( i!=-1 )
{
TCHAR a = DegMinSec.GetAt(i);
:
:
}
:
:
}
Sonu - 24 Jun 2005 23:20 GMT
> Hi all,
> Does VS.net catches more run time errors than VS 6.0???
[quoted text clipped - 55 lines]
> :
> }
Also,
The application is built for Unicode.
DegMinSec seems to have a decent looking vlaue like "4:56"
When I step into the DegMinSec.GetAt(i) which is defines as following"
XCHAR GetAt( int iChar ) const
{
ATLASSERT( (iChar >= 0) && (iChar <= GetLength()) ); // Indexing the '\0'
is OK
if( (iChar < 0) || (iChar > GetLength()) )
AtlThrow(E_INVALIDARG);
return( m_pszData[iChar] );
}
It seems to have a length of 0 and so it gives an assertion failure. (ichar
has a value of 2 as it should be)
Any help is much appreciated
Thanks
Srishti