by carlos vargas » Fri Oct 08, 2021 5:32 pm
Gustavo, aca este ejemplo me funciono bien, prueba con tu version de fwh
es un dialog, con database embebido como en el modulo que me mostraste ayer.
goos.prg
- Code: Select all Expand view RUN
#include "fivewin.ch"
//poner este prg en fwh\samples
REQUEST DBFCDX
procedure main()
local oCn, oQry, cDataFolder, cLangFolder
local oDlg, oBrw
cDataFolder := "d:\fwh\samples\test\" //hacer esta carpeta
cLangFolder := "d:\fwh\samples\"
FWCONNECT oCn HOST cDataFolder LANGFOLDER cLangFolder DATABASE "fwh"
if oCn == nil
? "Connect fail"
return
endif
//luego de la primera ejecucion, puedes comentar estas dos lineas.
oCn:importfromdbf( "states.dbf" )
xbrowser oCn:states
oQry := oCn:RowSet( "select * from states" )
fwdbg oCn, oQry
define dialog oDlg name "mydlg"
redefine xbrowse oBrw id 101 of oDlg datasource oQry columns "code", "name" autosort
redefine button id 102 of oDlg action AddRow( oCn, oQry, oBrw )
redefine button id 103 of oDlg action oDlg:end()
activate dialog oDlg
oCn:close()
return
procedure AddRow( oCn, oQry, oBrw )
oCn:insert( "states", "code,name", { "MG", "MANAGUA-" + time() } )
?"Error:", oCn:nError
if oCn:nError <> 0
oCn:ShowError()
endif
oQry:Requery()
oBrw:refresh(.t.)
return
goos.rc
- Code: Select all Expand view RUN
// Generated by ResEdit 1.6.6// Copyright (C) 2006-2015// http://www.resedit.net#include <windows.h>
#ifndef WC_TABCONTROL
#define WC_TABCONTROL
"SysTabControl32"#endif
#ifndef MONTHCAL_CLASS
#define MONTHCAL_CLASS
"SysMonthCal32"#endif
#ifndef DATETIMEPICK_CLASS
#define DATETIMEPICK_CLASS
"SysDateTimePick32"#endif
#ifndef VOS__WINDOWS32
#define VOS__WINDOWS32 0x00000004L
#endif
#ifndef VFT_APP
#define VFT_APP 0x00000001L
#endif
#ifndef VFT2_UNKNOWN
#define VFT2_UNKNOWN 0x00000000L
#endif
#ifndef WC_STATIC
#define WC_STATIC
"Static"#endif
#include "resource.h"//// Dialog resources//MYDLG
DIALOG 0,
0,
304,
177STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION
"Dialog"FONT 8,
"Ms Shell Dlg"{ CONTROL
"",
101,
"TXBrowse", 0x50020000,
7,
12,
290,
138, 0x00000000
PUSHBUTTON
"Agregar",
102,
7,
155,
56,
15,
0, WS_EX_LEFT
PUSHBUTTON
"Cerrar",
103,
241,
155,
56,
15,
0, WS_EX_LEFT
}
resource.h
- Code: Select all Expand view RUN
#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)