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.

2007/11/15, Dmitry Grinberg <[EMAIL PROTECTED]>:
>
> is the buffer txt allocated?
> if so, please do an ASSERT(MemPtrSize(txt)>NameLen), and make sure that is
> ok
>
> On Nov 15, 2007 2:08 PM, Jonathan Carse <[EMAIL PROTECTED]> wrote:
> >
> > Interesting about the NULL behavior.
> > txt was generated using StrPrintF(), which I never had problems with.
> I'm
> > pretty sure it appends NULL to the end of the string.
> >
> >  So, nice idea but not the case here.
> >
> > What else can it be?
> >
>

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to