Well, that settles it. I ran some more testing.
Here's the code again:
WriteToLog("Calling WinDrawChars()\n");
WinDrawChars((Char*)txt,NameLen,bounds->topLeft.x+nRightX-NameWidth,
bounds->topLeft.y);
WriteToLog("Called WinDrawChars()\n");
WriteToLog() writes to a log file on a memory card using VFS.
I run my program under debug - everything works fine. (The log file ends
with "Called WinDrawChars()")
I run my program regularly, the forms draws OK, and when it's time to draw
the text - "Fatal exception".
I take a look at the log file:
Calling GetDirectoryDateTime()
Called GetBackupDateTime()
Calling DrawTextInList()
Calling WinDrawChars()
That's it. The log ends there.
WinDrawChars() fails under regular execution, and not under debug.
I'm completely stumped.
Oh and, yes, I tried running without writing to the log file. Same outcome.
Anyone, please?
2007/11/16, Jonathan Carse <[EMAIL PROTECTED]>:
>
> txt was not dynamically allocated.
> txt is a pointer to a buffer that was declared as a local variable in the
> previous function.
> Something like:
>
> void Func()
> {
> Char szDateTime[25];
>
> StrPrintF(szDateTime, "%02d/%02d/%02d %02d:%02d",
> dtCurrentBackupDateTime.day, dtCurrentBackupDateTime.month,
> dtCurrentBackupDateTime.year, dtCurrentBackupDateTime.hour,
> dtCurrentBackupDateTime.minute );
>
> Print(szDateTime);
> }
>
> void Print(Char* txt)
> {
> ...
> NameLen = StrLen((Char*)txt);
> WinDrawChars((Char*)txt, NameLen, bounds->topLeft.x+nRightX-NameWidth,
> bounds->topLeft.y );
> ...
> }
>
>
> As I said, this works fine when debugging using GDB.
> When no debugger is attached, it throws a fatal exception.
>
>
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/