FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour WBrowse changes the current file record by itself
Posts: 124
Joined: Mon Nov 14, 2005 10:15 AM
Re: WBrowse changes the current file record by itself
Posted: Fri Feb 03, 2012 12:09 PM
Antonio Linares wrote:As Enrico has pointed, the problem comes from changing the focus meanwhile the browse is working.
If you need to check some values, etc. you can use the function LogFile() or change the caption of the window, etc. Use other ways to report info without interfering with the focus :-)

Hi Antonio.
Sorry I didn't get it...
This isn't a bug ?
It is the expected behavior ?

[[]] Maurício
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: WBrowse changes the current file record by itself
Posted: Fri Feb 03, 2012 12:35 PM

There are many places in an event driven application (like the Windows GUI one) in which you can find strange behavior if the focus is altered.

EMG

Posts: 124
Joined: Mon Nov 14, 2005 10:15 AM
Re: WBrowse changes the current file record by itself
Posted: Mon Feb 06, 2012 04:06 PM
Enrico Maria Giordano wrote:There are many places in an event driven application (like the Windows GUI one) in which you can find strange behavior if the focus is altered.

EMG

Seems I am too dumb, still didn't understand.
Is this a bug or the expected behavior ?
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: WBrowse changes the current file record by itself
Posted: Mon Feb 06, 2012 07:45 PM

Hard to say. You have to check without changing the focus and if the problem is still there it could be a bug.

EMG

Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: WBrowse changes the current file record by itself
Posted: Mon Feb 06, 2012 10:48 PM
you can use
debug function for bypass the focus in controls.

dbwin32.exe or dbgview.exe


Code (fw): Select all Collapse
function main()
   ?KDSDebug( version() )
return

FUNCTION KDSDebug( xVal, lReturn )
   DEFAULT lReturn := FALSE

   OutPutDebugStringC( CStr( xVal ) + IIf( lReturn, FINL, "" )  )

RETURN NIL

#pragma BEGINDUMP

/*definición de constante necesaria para compilador XCC de xharbour.com*/
#ifndef __BORLANDC__
   #define WINVER 5
#endif

#ifdef __XCC__
#endif

/*llamada a encabezados de api de xharbour y windows SDK*/
#include "hbapi.h"
#include "windows.h"

/*funcion wrapper de api para mostrar un valor en un depurador*/
HB_FUNC( OUTPUTDEBUGSTRINGC )
{
    PHB_ITEM szMsg = hb_param(1, HB_IT_STRING );

    if( szMsg != NULL )
    {
        OutputDebugStringA( hb_itemGetC( szMsg ) );
        OutputDebugStringA( "\n" );
    }
    hb_retc( "" );
}

#pragma ENDDUMP
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 124
Joined: Mon Nov 14, 2005 10:15 AM
Re: WBrowse changes the current file record by itself
Posted: Tue Feb 07, 2012 03:27 PM

Ok.

Since in the sample if I only replace wbrowse to xbrowse the problem disappears, no mater focus changing, it's clear to me that wbrowse i buggy !

And wbrowse should be avoided, deprecated to xbrowse, in order to avoid unpredictable behavior.

So I will hunt for wbrowse in all my code and replace with xbrowse.

Continue the discussion