On Sat, 08 Nov 2008, David Arturo Macias Corona wrote:

Hi David.

> Did you see this info in gtos2.c about 16 bit ?
> -------------
>  * Copyright 2000 - 2001 Maurilio Longo <[EMAIL PROTECTED]>
>  *    hb_gt_DispBegin() / hb_gt_DispEnd()
>  *    hb_gt_ScreenPtr() and hb_gt_xYYYY() functions and virtual screen 
> support inside hb_gt_XXXX()s
>  *    16 bit KBD subsystem use inside hb_gt_os2_ReadKey()
> -------------

Yes, I've seen it but if I understand the OS2 API dependencies it should
not be the source of the problem. At least not directly.

> Using HB_GT_OS2_DEFAULT
> 1. hb_threadMutexLock()
> _hb_gettid()
> TID=2
> _hb_gettid()
> TID=2
> 2. hb_threadMutexLock()
> 2. hb_inkeyPoll()
> 3. hb_inkeyPoll()
> SYS1808:
> The process has stopped.  The software diagnostic
> code (exception code) is  0001.

So it fails before hb_gt_os2_ReadKey().
Let's check all steps.
HB_GTSELF_INKEYPOLL( pGT ) executes hb_gt_def_InkeyPoll() from
hbgtcore.c. Then hb_gt_def_InkeyPollDo() is called which calls
   iKey = HB_GTSELF_READKEY( pGT, INKEY_ALL );

Please change hb_gt_def_InkeyPoll() and hb_gt_def_InkeyPollDo().

best regards,
Przemek


/* helper internal function */
static void hb_gt_def_InkeyPollDo( PHB_GT pGT )
{
   int iKey;

   HB_TRACE( HB_TR_DEBUG, ("hb_gt_def_InkeyPollDo(%p)", pGT) );

   printf("1. "hb_gt_def_InkeyPollDo()\r\n");fflush(stdout);
   iKey = HB_GTSELF_READKEY( pGT, INKEY_ALL );
   printf("2. "hb_gt_def_InkeyPollDo()\r\n");fflush(stdout);

   if( iKey )
   {
      switch( iKey )
      {
         case HB_BREAK_FLAG:           /* Check for Ctrl+Break */
         case K_ALT_C:                 /* Check for normal Alt+C */
            if( hb_setGetCancel() )
            {
               hb_vmRequestCancel();   /* Request cancellation */
               return;
            }
            break;
         case K_ALT_D:                 /* Check for Alt+D */
            if( hb_setGetDebug() )
            {
               hb_vmRequestDebug();    /* Request the debugger */
               return;
            }
      }
      printf("3. "hb_gt_def_InkeyPollDo()\r\n");fflush(stdout);
      HB_GTSELF_INKEYPUT( pGT, iKey );
      printf("4. "hb_gt_def_InkeyPollDo()\r\n");fflush(stdout);
   }
}

/* Poll the console keyboard to stuff the Harbour buffer */
static void hb_gt_def_InkeyPoll( PHB_GT pGT )
{
   HB_TRACE( HB_TR_DEBUG, ("hb_gt_def_InkeyPoll(%p)", pGT) );

   /*
    * Clipper 5.3 always poll events without respecting
    * _SET_TYPEAHEAD when CL5.2 only when it's non zero.
    * IMHO keeping CL5.2 behavior will be more accurate for xharbour
    * because it allow to control it by user what some times could be
    * necessary due to different low level GT behavior on some platforms
    */
   printf("1. "hb_gt_def_InkeyPoll()\r\n");fflush(stdout);
   if( hb_setGetTypeAhead() )
   {
      printf("2. "hb_gt_def_InkeyPoll()\r\n");fflush(stdout);
      hb_gt_def_InkeyPollDo( pGT );
      printf("3. "hb_gt_def_InkeyPoll()\r\n");fflush(stdout);
   }
}

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to