I'm sorry, I forgot perhaps code that may be causes this error:

Boolean ApplicationHandleEvent(EventPtr event)
{
        FormPtr frm;
        Word    formId;
        Boolean bHandled=false;

        if (event->eType==frmLoadEvent)
        {
                formId=event->data.frmLoad.formID;
                frm=FrmInitForm(formId);
                FrmSetActiveForm(frm);
                switch (formId)
                {
                        case MainForm:
                                FrmSetEventHandler
(frm,MainFormHandleEvent);

                                break;
                }
                bHandled=true;
        }
        return bHandled;
}

static Boolean MainFormHandleEvent(EventPtr event)
{
FormPtr frm;
Boolean         handled = false;
EventType       newEvent;

switch(event->eType)
{
  case frmOpenEvent:
        frm=FrmGetActiveForm();
        FrmDrawForm(frm);
        handled=true;
        break;
  case ctlSelectEvent:
        switch( event->data.ctlEnter.controlID )
        {
           case MainExitButton:
                MemSet(&newEvent, sizeof(EventType), 0);
                newEvent.eType = appStopEvent;
                EvtAddEventToQueue(&newEvent);
                handled = true;
                break;
        }
        handled=true;
        break;

  case menuEvent:
        MenuEraseStatus(CurrentMenu);
        frm=ProcesarComando(event->data.menu.itemID);
        handled = true;
        break;
}
return handled;
}

FormPtr  ProcesarComando(Word comando)
{
        FormPtr frm;
        Err             error;
        VoidHand reg;
        Localizacion *l;
        UInt    mode=dmModeReadWrite;
        int cont=0;

switch(comando)
{
    <code.......>
    <code.....>

  case MainVentanasUbicacion:
        FrmCloseAllForms();
        frm=FrmInitForm(UbicacionForm);
        FrmSetActiveForm(frm);
        FrmDrawForm(frm);

       <code...>
       <code...>
        Ini_BarcodeScanner();
        FrmSetEventHandler(frm,UbicacionHandleEvent);
        FrmSetFocus(frm,FrmGetObjectIndex(frm,fldIdFoco2));
        break;
}
return (frm);
}


Boolean  UbicacionHandleEvent(EventPtr event)
{
        Word focusIndex=0;
        FormPtr frm;
        Boolean bHandled=false;
        Boolean HechoAlgo=false;
        UInt fldIdFoco3=0;

switch(event->eType)
{
   case scanDecodeEvent:
        OnDecoderDataUbicacion();
        bHandled=true;
        break;
   case ctlSelectEvent:
    if (event->data.ctlEnter.controlID==UbicacionCerrarButton)
    {
                DmCloseDatabase(gUbicacionDB);
                CerrarScanner();
                frm=FrmGetActiveForm();
                FrmEraseForm(frm);
                FrmDeleteForm(frm);
                FrmGotoForm(MainForm);
                SetCurrentMenu(MainFormMenuBar);
                bHandled=true;
                break;
    }
    <code.......>
    <code.......>
}
return(bHandled);
}




--- In [EMAIL PROTECTED], "victor rey" <[EMAIL PROTECTED]>
wrote:
>Hi,
>as the subject says I'm getting this error message and I need help,
a
>lot of help. After reading all messages about this error I don't get
>solving this one. I read, for example, if in close event I returned
>true I had to do first frmeraseform and then frmdeleteform. I do it.
>I too read that this error could be cause because I was trying
>unlocked something that wasn't locked. I looked for it and I think
>code is right. As I have been getting other errors I 've seen all
>occurs to me: indexes, locked and unlocked counts, first lock and
>then unlock, first frmeraseform and then frmdeleteform, etc.
>
>In the application I've got 4 process. They are almost the same. If
I
>don�t go in one process, I can go in and exit from all of the other
>three process. I can go out for application and then I can go in
>again as many times as I want. But if I go in other process and then
>I exit from the application, I get this error, or I can go in again
>but then it appears. Sometimes too, after a lot of time it appears.
>
>So, I need help. Could anybody say other causes that produce this
>error? Any idea or clue?
>
>
>
>Thanks for advance
>

_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


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

Reply via email to