Help with Creator ID changes and StartApplication problem

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 02:37:32



A problem has suddenly developed with an application that I've developed
that had been working fine.

It is now failing at the StartApplication phase when it tries to get the
main and only application database

 db = DmOpenDatabaseByTypeCreator(FxDBType, FxCreatorID, mode);
 if (! db) {
     error = DmCreateDatabase(0, FxDBName, FxCreatorID, FxDBType, false);

I am getting an error of 0x0219 back (dmErrNotValidRecord).

I'm confused as this application had been working fine. The only thing I can
think, is that I've been experimenting with creating a new instance of the
application with a separate creator ID and database name. I wonder if
something has not re-linked when I've changed the settings back or
something?
I've checked and re-checked that the data in CW settings / Palm Rez Post
Linker are the same as those defined in my app. The settings are also set
for type = appl.

Any help appreciated.

Michael

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Ben Combe » Wed, 03 Apr 2002 03:16:23




Quote:> A problem has suddenly developed with an application that I've developed
> that had been working fine.

> It is now failing at the StartApplication phase when it tries to get the
> main and only application database

>  db = DmOpenDatabaseByTypeCreator(FxDBType, FxCreatorID, mode);
>  if (! db) {
>      error = DmCreateDatabase(0, FxDBName, FxCreatorID, FxDBType, false);

> I am getting an error of 0x0219 back (dmErrNotValidRecord).

> I'm confused as this application had been working fine. The only thing I can
> think, is that I've been experimenting with creating a new instance of the
> application with a separate creator ID and database name. I wonder if
> something has not re-linked when I've changed the settings back or
> something?
> I've checked and re-checked that the data in CW settings / Palm Rez Post
> Linker are the same as those defined in my app. The settings are also set
> for type = appl.

This is a case where getting a source code license from Palm can be
really useful, as you can track down from where that error is coming.  
This error can only be generated by a failed DmWriteCheck, which is
called by DmWrite to validate the write before it modifies memory.

DmCreateDatabase never calls DmWrite or its sister functions directly,
but it does make a call to add information about the DB you created to
the Launcher's db, and that uses DmWrite.

Is there a chance your launcher DB has gotten corrupted?  Have you tried
this on a clean emulator and seen this error?
--

CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 05:59:32


Ben
    Apologies but I made a mistake with my Hex. Error 0x0219 is error
dmErrAlreadyExists, which I understand to mean that a database of that name
already exists. It does not!

    I've started again and again with fresh ROMs or deleting failed
instances. I think your point about the launcher corruption is still an
avenue for me to explore. I'm confused however as a previous saved backup
version of the same application works fine - with the same set up.

I'll try and reinstall POSE. Any other ideas welcome

Michael




> > A problem has suddenly developed with an application that I've developed
> > that had been working fine.

> > It is now failing at the StartApplication phase when it tries to get the
> > main and only application database

> >  db = DmOpenDatabaseByTypeCreator(FxDBType, FxCreatorID, mode);
> >  if (! db) {
> >      error = DmCreateDatabase(0, FxDBName, FxCreatorID, FxDBType,
false);

> > I am getting an error of 0x0219 back (dmErrNotValidRecord).

> > I'm confused as this application had been working fine. The only thing I
can
> > think, is that I've been experimenting with creating a new instance of
the
> > application with a separate creator ID and database name. I wonder if
> > something has not re-linked when I've changed the settings back or
> > something?
> > I've checked and re-checked that the data in CW settings / Palm Rez Post
> > Linker are the same as those defined in my app. The settings are also
set
> > for type = appl.

> This is a case where getting a source code license from Palm can be
> really useful, as you can track down from where that error is coming.
> This error can only be generated by a failed DmWriteCheck, which is
> called by DmWrite to validate the write before it modifies memory.

> DmCreateDatabase never calls DmWrite or its sister functions directly,
> but it does make a call to add information about the DB you created to
> the Launcher's db, and that uses DmWrite.

> Is there a chance your launcher DB has gotten corrupted?  Have you tried
> this on a clean emulator and seen this error?
> --

> CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 07:03:04


This problem still occurs even after reinstalling POSE and even when
installing onto a live Palm.

This seems to me like I can rule out POSE problems. If I can run other
applications (either older versions of my code or other source code
examples) through  CW and onto POSE then this also confirms this.

I'm not familiar with its usage but is the psym file a potential area to
explore?

I still think that this was caused by me modifying the creator ID and
database name settings in CW and in my source code to test having two
instance of the app running together. It seems like some of the names are
stored somewhere in an "ini" type supporting file. Maybe this is going into
the compiler and causing the apparent conflict. I'm hoping that this will
trigger something with you...........

Any help appreciated

Michael




> > A problem has suddenly developed with an application that I've developed
> > that had been working fine.

> > It is now failing at the StartApplication phase when it tries to get the
> > main and only application database

> >  db = DmOpenDatabaseByTypeCreator(FxDBType, FxCreatorID, mode);
> >  if (! db) {
> >      error = DmCreateDatabase(0, FxDBName, FxCreatorID, FxDBType,
false);

> > I am getting an error of 0x0219 back (dmErrNotValidRecord).

> > I'm confused as this application had been working fine. The only thing I
can
> > think, is that I've been experimenting with creating a new instance of
the
> > application with a separate creator ID and database name. I wonder if
> > something has not re-linked when I've changed the settings back or
> > something?
> > I've checked and re-checked that the data in CW settings / Palm Rez Post
> > Linker are the same as those defined in my app. The settings are also
set
> > for type = appl.

> This is a case where getting a source code license from Palm can be
> really useful, as you can track down from where that error is coming.
> This error can only be generated by a failed DmWriteCheck, which is
> called by DmWrite to validate the write before it modifies memory.

> DmCreateDatabase never calls DmWrite or its sister functions directly,
> but it does make a call to add information about the DB you created to
> the Launcher's db, and that uses DmWrite.

> Is there a chance your launcher DB has gotten corrupted?  Have you tried
> this on a clean emulator and seen this error?
> --

> CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Ben Combe » Wed, 03 Apr 2002 14:48:28




Quote:> This problem still occurs even after reinstalling POSE and even when
> installing onto a live Palm.

> This seems to me like I can rule out POSE problems. If I can run other
> applications (either older versions of my code or other source code
> examples) through  CW and onto POSE then this also confirms this.

> I'm not familiar with its usage but is the psym file a potential area to
> explore?

psym files are the files that hold debugging information that
CodeWarrior uses to map memory locations to variables and source code
lines.  This is automatically rebuilt everytime you build your
application.

Quote:> I still think that this was caused by me modifying the creator ID and
> database name settings in CW and in my source code to test having two
> instance of the app running together. It seems like some of the names are
> stored somewhere in an "ini" type supporting file. Maybe this is going into
> the compiler and causing the apparent conflict. I'm hoping that this will
> trigger something with you...........

The only place where setting a creator ID affects the output file is in
the PalmRez Post Linker settings.  People often have the creator ID
defined in a header file too, so you need to make sure that stays in
sync.  The database name must be unique on the device -- that's why
people usually append their creator ID to the DB name, since it makes
names unique among applications.

--

CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 17:57:49


Ben
    Thanks for your help. It's definitely some sort of corrupted file but I
can figure out where.

    I start a new session of POSE with a clean ROM and definitely not with
any instantiation of my app. If I then run my app in debug mode from CW7 but
stop it before it has completed the first step below............
UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
......an instance of the application has appeared in POSE applications view!
This instance is corrupt and displays the behaviour I've already described -
if you click on it, it will flash but not start.

If I delete this program (Menu/Delete) and re-start CW and stop it again at
PilotMain, then the same thing happens!

I've obviously got some sort of corrupt reference to a previous instance of
the application that as CW fires up is being pulled back into the session.

I've tried the "Remove Object Code" command from CW but the same problem
happens.

I've also tried creating a totally different set of creator ID and DB names
( #defined in my code and the same in PalmRez Post Linker) but the same
problem happens!

Any help appreciated as always.

Michael




> > This problem still occurs even after reinstalling POSE and even when
> > installing onto a live Palm.

> > This seems to me like I can rule out POSE problems. If I can run other
> > applications (either older versions of my code or other source code
> > examples) through  CW and onto POSE then this also confirms this.

> > I'm not familiar with its usage but is the psym file a potential area to
> > explore?

> psym files are the files that hold debugging information that
> CodeWarrior uses to map memory locations to variables and source code
> lines.  This is automatically rebuilt everytime you build your
> application.

> > I still think that this was caused by me modifying the creator ID and
> > database name settings in CW and in my source code to test having two
> > instance of the app running together. It seems like some of the names
are
> > stored somewhere in an "ini" type supporting file. Maybe this is going
into
> > the compiler and causing the apparent conflict. I'm hoping that this
will
> > trigger something with you...........

> The only place where setting a creator ID affects the output file is in
> the PalmRez Post Linker settings.  People often have the creator ID
> defined in a header file too, so you need to make sure that stays in
> sync.  The database name must be unique on the device -- that's why
> people usually append their creator ID to the DB name, since it makes
> names unique among applications.

> --

> CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 18:10:30


Sorry but of course I meant, "It's definitely some sort of corrupted file
but I CAN'T figure out where."

Hence, any help appreciated


> Ben
>     Thanks for your help. It's definitely some sort of corrupted file but
I
> can figure out where.

>     I start a new session of POSE with a clean ROM and definitely not with
> any instantiation of my app. If I then run my app in debug mode from CW7
but
> stop it before it has completed the first step below............
> UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
> {
> ......an instance of the application has appeared in POSE applications
view!
> This instance is corrupt and displays the behaviour I've already
described -
> if you click on it, it will flash but not start.

> If I delete this program (Menu/Delete) and re-start CW and stop it again
at
> PilotMain, then the same thing happens!

> I've obviously got some sort of corrupt reference to a previous instance
of
> the application that as CW fires up is being pulled back into the session.

> I've tried the "Remove Object Code" command from CW but the same problem
> happens.

> I've also tried creating a totally different set of creator ID and DB
names
> ( #defined in my code and the same in PalmRez Post Linker) but the same
> problem happens!

> Any help appreciated as always.

> Michael





> > > This problem still occurs even after reinstalling POSE and even when
> > > installing onto a live Palm.

> > > This seems to me like I can rule out POSE problems. If I can run other
> > > applications (either older versions of my code or other source code
> > > examples) through  CW and onto POSE then this also confirms this.

> > > I'm not familiar with its usage but is the psym file a potential area
to
> > > explore?

> > psym files are the files that hold debugging information that
> > CodeWarrior uses to map memory locations to variables and source code
> > lines.  This is automatically rebuilt everytime you build your
> > application.

> > > I still think that this was caused by me modifying the creator ID and
> > > database name settings in CW and in my source code to test having two
> > > instance of the app running together. It seems like some of the names
> are
> > > stored somewhere in an "ini" type supporting file. Maybe this is going
> into
> > > the compiler and causing the apparent conflict. I'm hoping that this
> will
> > > trigger something with you...........

> > The only place where setting a creator ID affects the output file is in
> > the PalmRez Post Linker settings.  People often have the creator ID
> > defined in a header file too, so you need to make sure that stays in
> > sync.  The database name must be unique on the device -- that's why
> > people usually append their creator ID to the DB name, since it makes
> > names unique among applications.

> > --

> > CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Wed, 03 Apr 2002 21:37:18


Ben (and for any others who may get this problem)
    I've 'fixed' it. It seems to have been some sort of clash between the
database name declared in CW Palm Rez Post Linker and that #defined in my
code. If I deleted the CW field and left it empty, the problem has gone.

    I don't understand however as I thought you were meant to have an entry
in that field that would tally with the definition in the code:

#define DBName         "DBNAME-ABCD"

Thanks for your help

Michael


> Ben
>     Thanks for your help. It's definitely some sort of corrupted file but
I
> can figure out where.

>     I start a new session of POSE with a clean ROM and definitely not with
> any instantiation of my app. If I then run my app in debug mode from CW7
but
> stop it before it has completed the first step below............
> UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
> {
> ......an instance of the application has appeared in POSE applications
view!
> This instance is corrupt and displays the behaviour I've already
described -
> if you click on it, it will flash but not start.

> If I delete this program (Menu/Delete) and re-start CW and stop it again
at
> PilotMain, then the same thing happens!

> I've obviously got some sort of corrupt reference to a previous instance
of
> the application that as CW fires up is being pulled back into the session.

> I've tried the "Remove Object Code" command from CW but the same problem
> happens.

> I've also tried creating a totally different set of creator ID and DB
names
> ( #defined in my code and the same in PalmRez Post Linker) but the same
> problem happens!

> Any help appreciated as always.

> Michael





> > > This problem still occurs even after reinstalling POSE and even when
> > > installing onto a live Palm.

> > > This seems to me like I can rule out POSE problems. If I can run other
> > > applications (either older versions of my code or other source code
> > > examples) through  CW and onto POSE then this also confirms this.

> > > I'm not familiar with its usage but is the psym file a potential area
to
> > > explore?

> > psym files are the files that hold debugging information that
> > CodeWarrior uses to map memory locations to variables and source code
> > lines.  This is automatically rebuilt everytime you build your
> > application.

> > > I still think that this was caused by me modifying the creator ID and
> > > database name settings in CW and in my source code to test having two
> > > instance of the app running together. It seems like some of the names
> are
> > > stored somewhere in an "ini" type supporting file. Maybe this is going
> into
> > > the compiler and causing the apparent conflict. I'm hoping that this
> will
> > > trigger something with you...........

> > The only place where setting a creator ID affects the output file is in
> > the PalmRez Post Linker settings.  People often have the creator ID
> > defined in a header file too, so you need to make sure that stays in
> > sync.  The database name must be unique on the device -- that's why
> > people usually append their creator ID to the DB name, since it makes
> > names unique among applications.

> > --

> > CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Ben Combe » Thu, 04 Apr 2002 01:07:02




Quote:> Ben (and for any others who may get this problem)
>     I've 'fixed' it. It seems to have been some sort of clash between the
> database name declared in CW Palm Rez Post Linker and that #defined in my
> code. If I deleted the CW field and left it empty, the problem has gone.

>     I don't understand however as I thought you were meant to have an entry
> in that field that would tally with the definition in the code:

> #define DBName         "DBNAME-ABCD"

Michael, you do realize that the database name setting in the PalmRez
panel refers to the name of your program file on the device, not the
name of the database file your program is manipulating, right?

All programs are resource databases, and the program defaults to a
database name of whatever its PRC file name is, minus the PRC suffix.  
If you fill this in, your program will get that as its DB name instead.  
Any DBs you create in your app must have different names than the one
specified here.

--

CodeWarrior for Palm OS technical lead

 
 
 

Help with Creator ID changes and StartApplication problem

Post by Michael Kin » Thu, 04 Apr 2002 01:27:24


Doh!

I'll get my coat and leave shall I? ;)

Thanks for the lesson.


> e (news-binary.blueyonder.co.uk)



> > Ben (and for any others who may get this problem)
> >     I've 'fixed' it. It seems to have been some sort of clash between
the
> > database name declared in CW Palm Rez Post Linker and that #defined in
my
> > code. If I deleted the CW field and left it empty, the problem has gone.

> >     I don't understand however as I thought you were meant to have an
entry
> > in that field that would tally with the definition in the code:

> > #define DBName         "DBNAME-ABCD"

> Michael, you do realize that the database name setting in the PalmRez
> panel refers to the name of your program file on the device, not the
> name of the database file your program is manipulating, right?

> All programs are resource databases, and the program defaults to a
> database name of whatever its PRC file name is, minus the PRC suffix.
> If you fill this in, your program will get that as its DB name instead.
> Any DBs you create in your app must have different names than the one
> specified here.

> --

> CodeWarrior for Palm OS technical lead