> > CApptDBConnection* pApptDB = new CApptDBConnection;
>
> Do you have a custom version of operator new? In CodeWarrior (though you
> don't say which toolset you are using) the default operator new has some
> exception logic which (I believe) requires global variables. That
wouldn't
> work right in a no-globals launch code such as Find.
I overloaded the new and delete operators. The new new calls MemPtrNew.
> > dbP = pApptDB->GetDmOpenRef();
>
> Virtual functions don't work without globals either, so
> CApptDBConnection::GetDmOpenRef needs to be non virtual.
CApptDBConnection::GetDmOpenRef() is not a virtual function.
> Why the memory allocation? Why not just use one line:
I did the memory allocation because I copied most of the code from the book
and that's how it does it.
Why would any of this cause a local UInt to either be out of scope or
whatever may cause it to be uninitialized?
"Scott Johnson (Bellevue)" <[EMAIL PROTECTED]> wrote in message
news:34711@palm-dev-forum...
>
> > From: Jason Henderson [mailto:[EMAIL PROTECTED]]
> > I am trying to put the global find functionality into my app [...]
> > the heck is going on?! Does this have something to do with the no
global
> > variables rule when using the find? If so, what's the workaround?
>
> Well I do see some suspicious things in the code:
>
> > CApptDBConnection* pApptDB = new CApptDBConnection;
>
> Do you have a custom version of operator new? In CodeWarrior (though you
> don't say which toolset you are using) the default operator new has some
> exception logic which (I believe) requires global variables. That
wouldn't
> work right in a no-globals launch code such as Find.
>
> > dbP = pApptDB->GetDmOpenRef();
>
> Virtual functions don't work without globals either, so
> CApptDBConnection::GetDmOpenRef needs to be non virtual.
>
> > // display the heading line
> > header = (CharPtr) MemPtrNew(21);
> > StrCopy(header, "EagleSoft - Schedule");
> > done = FindDrawHeader(findParams, header);
> > MemPtrFree(header);
>
> Why the memory allocation? Why not just use one line:
>
> done = FindDrawHeader( findParams, "EagleSoft - Schedule" );
>
> -slj-
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/