FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC LISTBOX ALIAS
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

LISTBOX ALIAS

Posted: Sun Jun 06, 2010 07:27 AM

I have a listbox where I show the data.
I close the database and then I send the dbf-file back to the server.

In case that something goes wrong the user should return to the previous status.

select rechnung
use

oLbxRG:lCloseArea() // if I use lCloseArea the msginfo is ok otherwise I get an error

But then I find no way how to "oLbxRG:lOpenArea()" - how to rebind the oLbxRg again

lret := MEMOWRIT2(cSrc, cDSt )

lret := .f. //procl for testing a network error

if lret = .f.

Msginfo1 ( "N e t z w e r k f e h l e r" )

USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"

endif

Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 07:51 AM

Otto,

Class TWBrowse Method lCloseArea() calls DbCloseArea(), so after calling it you may need to USE the DBF again if you need to manage it again

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 07:58 AM

Hello Antonio,
I tried to do this but with no result:

if lret = .f.
USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"
oLbxRG:show()
oLbxRG:gotop()
oLbxRG:refresh()
endif

Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:05 AM

Otto,

Why do you close the DBF and try to open it again from the same browse ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:16 AM

Antonio,
doesn't PPC open the dbf-exclusivly?
I will check if I can copy a opened dbf back to the server.
Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:33 AM

Otto,

> doesn't PPC open the dbf-exclusivly?

I have not checked it myself

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:34 AM

Antonio,
It I try to copy the opened dbf i get a dbf on the server with 0 byte.
Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:44 AM

Otto,

Have you tried to copy it before USE ing it ?

How do you copy it ? What source code do you use ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:47 AM
Antonio,
If the file is not opend all is working.
This is the code I use:
Best regards,
Otto


Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <hbapiitm.h>
#include "hbapifs.h"
#include <aygshell.h>

#include <windows.h>



HB_FUNC( MEMOWRIT2 )

{
PHB_ITEM pFileName = hb_param( 1, HB_IT_STRING );
   PHB_ITEM pString = hb_param( 2, HB_IT_STRING );
BOOL bWriteEof = FALSE; /* write Eof !, by default is .T. */
BOOL bRetVal = FALSE;

   if( hb_parinfo(0) == 3                       && ISLOG( 3 ) )
bWriteEof = hb_parl( 3 );

   if( pFileName                                && pString )
{
FHANDLE fhnd = hb_fsCreate( ( BYTE * ) hb_itemGetCPtr( pFileName ), FC_NORMAL );

   if( fhnd != FS_ERROR )
{
ULONG ulSize = hb_itemGetCLen( pString );

   bRetVal = ( hb_fsWriteLarge( fhnd, ( BYTE * ) hb_itemGetCPtr( pString ), ulSize ) == ulSize );

/* NOTE: CA-Clipper will add the EOF even if the write failed. [vszakats] */
/* NOTE: CA-Clipper will not return .F. when the EOF could not be written. [vszakats] */
#if ! defined(OS_UNIX_COMPATIBLE)
{
if( bWriteEof ) /* if true, then write EOF */
{
BYTE byEOF = HB_CHAR_EOF;

   hb_fsWrite( fhnd, &byEOF, sizeof( BYTE ) );
   }
}
#endif

hb_fsClose( fhnd );
   }
}

hb_retl( bRetVal );
   }

HB_FUNC( DLGFULLSCREEN )
{
   SHINITDLGINFO shidi;

   memset( &shidi, 0, sizeof( SHINITDLGINFO ) );

   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;

   SHInitDialog( &shidi );
}

HB_FUNC( NUMSERIETARJETA )
{
BY_HANDLE_FILE_INFORMATION bHinfo;

memset( &bHinfo, 0 , sizeof(bHinfo) );

GetFileInformationByHandle( (HANDLE) hb_parnl(1), &bHinfo );
hb_retnl( bHinfo.dwVolumeSerialNumber );

}

#pragma ENDDUMP

//----------------------------------------------------------------------------//
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 08:54 AM

Otto,

have you tried to USE the DBF in shared mode ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 09:38 AM

Antonio,
thank you. SHARED works. But I am uncertain if SHARED is ready for use with PPC.
There are some posts in this forum which report of problems.
Would you suggest to use it?
Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 09:53 AM

Otto,

The FWPPC build that we published in march this year it is based on march Harbour and imo shared should work fine.

We were using a much more older Harbour previously so hence the shared complains. Anyhow, you tests will have the final word :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Sun Jun 06, 2010 10:01 AM

Antonio,
thank you.
I shall install the new version of PPC and do more tests.
Best regards,
Otto

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM

Re: LISTBOX ALIAS

Posted: Mon Jun 07, 2010 06:40 AM

Otto

Shared mode works OK with fwppc, my app uses it since quite a while

PS : i am using an old version of fwppc

Hth

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: LISTBOX ALIAS

Posted: Mon Jun 07, 2010 11:42 AM

Hello Richard,
thank you for the information.
Best regards,
Otto
PS: Oh, a new photo!

Continue the discussion