LISTBOX ALIAS

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

LISTBOX ALIAS

Post by Otto »

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

Otto,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

Otto,

> doesn't PPC open the dbf-exclusivly?

I have not checked it myself
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

Antonio,
It I try to copy the opened dbf i get a dbf on the server with 0 byte.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

Antonio,
If the file is not opend all is working.
This is the code I use:
Best regards,
Otto

Code: Select all

#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

//----------------------------------------------------------------------------//
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

Otto,

have you tried to USE the DBF in shared mode ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: LISTBOX ALIAS

Post by Antonio Linares »

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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

Antonio,
thank you.
I shall install the new version of PPC and do more tests.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: LISTBOX ALIAS

Post by Richard Chidiak »

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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: LISTBOX ALIAS

Post by Otto »

Hello Richard,
thank you for the information.
Best regards,
Otto
PS: Oh, a new photo!
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply