Re: Application crashes on CString.Format() call

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Have you stepped into the CString::Format() call to see why it crashes?
That'll give you a big clue as to what's wrong.

prashant_mandhare04@xxxxxxxxx wrote:
> Hi all,
>
> I have a VC6 application which crashes at following 2 code locations
> frequently (not every time) -
>
> location - 1
> ==========
> sSql.Format("INSERT INTO POSITIONREP (CARTRACKERID,POSITIONLAT,
> POSITIONLONG,FRAMETIMESTAMP,UPDATEDDATETIME,SPEED,
> HEADING,HEIGHT,HDOP,DRIVERID)"
> " VALUES ('%s','%lf','%lf','%s','%s','%lf','%lf','%lf','%d','%s')",
> StringToSQL(GprsPosData.ID), //this fun returns CString
> GprsPosData.Position.lat, //double
> GprsPosData.Position.lng, //double
> sFrameDate, //CString
> sUpdateDate, //CString
> GprsPosData.speed, //double
> dHeading, //double
> GprsPosData.Height* 100000, //double
> GprsPosData.HDOP, //int
> sDriverID); //CString
>
> location -2
> ==========
> sSqlQry.Format ("INSERT INTO TripPoints ("PntID, TRIPKEY, PntLat,
> PntLong, "
> " PntSpeed, PntDateTime, PntHeight, PntCourse, PntHDOP)"
> " VALUES ('%s', '%s', %s, %s, %s, %s, %s, %s, %s) " ,
> sPntID , sTripKey, row[0], row[1], row[2], sPtDate, row[5], row[6],
> row[7]);
> // (all parameters to Format() are CString type)
>
>
> Can anybody please clear me what exactly can go wrong with Format()
> method of CString above.
> Are there any known bugs/issues related to CString::Fromat() ?
>
> Thanks in advance!

.



Relevant Pages

  • Re: Outlook 2003 keeps corrupting my PST
    ... Also turned Microsoft spam filter off. ... trying the old format at first just to see if only the new formated ... transferred the PST to a laptop and used it with OL 2002 for two weeks ... > Please do send the reports whenever Outlook crashes. ...
    (microsoft.public.outlook)
  • Re: Word 2007 crashing when I try to save documents
    ... Hold down Ctrl as Word is starting, then click Yes to starting in Safe mode. ... Blog: http://word2007bible.herbtyson.com ... scratch and it still crashes. ... 97-2003 format, ...
    (microsoft.public.word.application.errors)
  • Re: Problem Exporting over 500000 records
    ... I'm using Access 2003 but my database has a 2000 format. ... serious amount of records to export, ... crashes. ...
    (microsoft.public.access.queries)
  • publisher 2002 crashes when saving
    ... ..pub format. ... run Win XP and everything was fine until I installed SP2. ... Still crashes. ... I use Publisher extensively & this is a BIG problem ...
    (microsoft.public.publisher)
  • Re: OE6 - Newsgroups
    ... --- "Steve Cochran" wrote in message ... He sent me a sample message and I couldn't see anything wrong with it, and also he said the crashes were inconsistent. ... He has called UofPhx tech support and they>> don't a clue what it is. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)