UInt16 InstalledDB(){

        Err err=0;
        DmSearchStateType stateInfo;
        LocalID dbID;
        UInt16 card;
        UInt32 wildcardCreator=appFileCreator;
        UInt16 i=0;
        Boolean newSearch=true;
        char nameP;
        UInt16 contChr;
        char *ptr;

        while (err==0) {
                err = DmGetNextDatabaseByTypeCreator(newSearch, &stateInfo,'DATA',
wildcardCreator,false, &card,&dbID);
                if (err==0){
                        instdb[i]=dbID;
                        DmDatabaseInfo (0,
instdb[i],&nameP,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
                        ptr = &nameP;
                        //metto il ciclo da 0 a 1 perch� deve prendere solo i primi 2 
car del
nome che identificano la provincia
                        //poi la funzione di scelta del DB gli attacca la stringa DB
                        for
(contChr=0;contChr<=1;contChr++){nomi[i].nomeDB[contChr]=ptr[contChr];}
                        i++;
                }
                newSearch=false;
        }
        if (i>15) i=15;
        return i;
}

if i use this function i get a BUS ERROR (read from a location 0x43444200,
causing bus error). If i make inactive the row "ptr = &nameP;" the program
works well, of course i can't get the db list. How i have to use this
function ? Where is the error?

Thanks to all.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to