Listbox no FWH 6.2

Listbox no FWH 6.2

Postby j.fmagalhaes » Thu Nov 11, 2010 5:30 pm

Preciso de ajuda. Estou a iniciar-me no FWH 6.2 e não consigo, nos exemplos apresentados em SAMPLES, ler um Listbox.
Dá o erro 1081. Isto por exemplo no CUSTOMER.PRG . Alguém poderá dar-me uma ajuda? Obrigados.
j.fmagalhaes
 
Posts: 14
Joined: Thu Nov 11, 2010 3:02 pm

Re: Listbox no FWH 6.2

Postby Euclides » Thu Nov 11, 2010 7:02 pm

Salve,
Se colocar as primeiras 25 linhas do arquivo ERROR.LOG gerado pelo erro, será mais fácil fazer algum disgnóstico.
Regards/Saludos
Euclides
User avatar
Euclides
 
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm

Re: Listbox no FWH 6.2

Postby j.fmagalhaes » Thu Nov 11, 2010 10:11 pm

Amigo Euclides
Obrigado pela pronta resposta.
Não envio o error.log, pois não dá leitura nenhuma, mas envio um PRG simplificado que compilado com o BUILDH que vem no FHW 6.12 compila o ficheiro, mas quando se clica em LISTAR, PEDIDOS e se passa com o cursor pela LISTBOX, dá o ERRO 1081.
Será necessário usar um ficheiro DBF qualquer, para dar leitura no LISTBOX.
Grato pelo interesse de uma solução para o meu problema.


#include "FiveWin.ch"
static oWnd
********************************************************************************
*
********************************************************************************
function Main()
local oIco, oBar, oBmp
SET _3DLOOK ON
DEFINE ICON oIco FILE "c:\Sdl\Diversos\fax.ico"
DEFINE WINDOW oWnd mdi; //FROM 1, 1 TO 22, 75 ;
TITLE "Sda-Registo de Telefonemas" ;
MENU BuildMenu() ;
COLOR "B/W" ;
ICON oIco
DEFINE BUTTONBAR oBar _3D SIZE 26, 27 OF oWnd
DEFINE BUTTON OF oBar FILENAME "c:\Sdl\Diversos\Exit.bmp" FLAT ;
ACTION oWnd:End() TOOLTIP "Sair do Programa" GROUP
DEFINE MESSAGE OF oWnd ;
PROMPT FWVERSION + " " + FWCOPYRIGHT ;
NOINSET CENTERED KEYBOARD DATE CLOCK
DEFINE BITMAP oBmp FILENAME "c:\sdl\diversos\fiveback.bmp"
oWnd:bPainted = { | hDC | BmpTiled( hDC, oWnd, oBmp ) }
ACTIVATE WINDOW oWnd ;
VALID MsgYesNo( "Quer Desligar?" )
return nil

********************************************************************************
*
********************************************************************************
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&Introduzir"
MENU
MENUITEM "&Pedidos";
ACTION Sdl_Clientes() ;
MESSAGE "Introduzir Dados de Novos"
ENDMENU
MENUITEM "&Listar"
MENU
MENUITEM "&Pedidos";
ACTION Sdl_Registo() ;
MESSAGE "Listar Dados Pedidos"
ENDMENU
ENDMENU
return oMenu

********************************************************************************
*
********************************************************************************
Function Sdl_Registo()
#define SDLCLI_LISTA 2
LOCAL oDlg, oWnd, oBrw
LOCAL Titulo:="AA"
LOCAL Seguir := .F.
Use tab_sld alias tab //este ou qualquer outro ficheiro *.dbf
DEFINE DIALOG oDlg RESOURCE SDLCLI_LISTA TITLE (Titulo) OF oWnd
REDEFINE LISTBOX oBrw ;
FIELDS ;
ID 101 OF oDlg ;
UPDATE
ACTIVATE DIALOG oDlg CENTERED
IF ! Seguir
dbCloseAll()
else
endif
dbCloseAll()
Return Nil

********************************************************************************
*
********************************************************************************
Function Sdl_Clientes
#define SDLCLI_DADOS 1
LOCAL oDlg, oWnd
LOCAL Seguir := .F.
DEFINE DIALOG oDlg RESOURCE SDLCLI_DADOS OF oWnd
ACTIVATE DIALOG oDlg CENTERED
IF ! Seguir
dbCloseAll()
else
endif
dbCloseAll()
Return Nil
********************************************************************************
*
********************************************************************************
STATIC FUNCTION BmpTiled( hDC, oWnd, oBmp )
local nWidth := oWnd:nWidth(), nHeight := oWnd:nHeight()
local nRow := 0, nCol := 0, n
local nBmpWidth := oBmp:nWidth(), nBmpHeight := oBmp:nHeight()
if oBmp:hBitmap == 0
return nil
endif
while nRow < nHeight
nCol = 0
while nCol < nWidth
PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )
nCol += nBmpWidth
end
nRow += nBmpHeight
end
return nil
********************************************************************************
*
********************************************************************************
procedure AppSys // Alaska XBase++ requirement
return
*****************
j.fmagalhaes
 
Posts: 14
Joined: Thu Nov 11, 2010 3:02 pm

Re: Listbox no FWH 6.2

Postby j.fmagalhaes » Fri Nov 12, 2010 1:33 pm

Amigo Euclides
Junto o ficheiro RC necessário à compilação que ontem por erro não seguiu.


/****************************************************************************


sdsa.rc

produced by Borland Resource Workshop


*****************************************************************************/

#define DIALOG_2 2
#define SDLCLI_LISTA 2
#define IDC_LISTBOX1 101
#define IDC_GROUPBOX3 102
#define DIALOG_1 1
#define SDLCLI_DADOS 1
#define IDC_GROUPBOX1 101
#define IDC_GROUPBOX2 102
#define IDC_EDIT1 103
#define IDC_EDIT2 104
#define IDC_EDIT3 105
#define IDC_EDIT4 106
#define IDC_EDIT5 107
#define IDC_EDIT6 108
#define IDC_EDIT7 109
#define IDC_EDIT8 110
#define IDC_EDIT9 111
#define IDC_EDIT10 112
#define IDC_EDIT11 113
#define IDC_EDIT12 114
#define IDC_EDIT13 115
#define IDC_EDIT14 116
#define IDC_EDIT15 117
#define IDC_EDIT16 118
#define IDC_EDIT17 119
#define IDC_EDIT18 120
#define IDC_EDIT19 121
#define IDC_EDIT20 122
SDLCLI_DADOS DIALOG 72, 58, 507, 251
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
{
CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 191, 226, 50, 14
CONTROL "Cancelar", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 263, 226, 50, 14
CONTROL "Dados", IDC_GROUPBOX1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 7, 10, 492, 193
CONTROL "Opções", IDC_GROUPBOX2, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 7, 210, 492, 34
CONTROL "Consumidor", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 28, 42, 8
CONTROL "", IDC_EDIT1, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 24, 45, 12
CONTROL "Cliente", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 130, 28, 28, 8
CONTROL "", IDC_EDIT2, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 168, 24, 45, 12
CONTROL "Contrato", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 230, 28, 32, 8
CONTROL "", IDC_EDIT3, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 272, 24, 45, 12
CONTROL "Nome", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 42, 31, 8
CONTROL "", IDC_EDIT4, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 38, 194, 12
CONTROL "Residência", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 258, 42, 40, 8
CONTROL "", IDC_EDIT5, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 300, 38, 194, 12
CONTROL "Freguesia", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 56, 34, 8
CONTROL "", IDC_EDIT6, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 52, 194, 12
CONTROL "CPostal", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 263, 56, 28, 8
CONTROL "", IDC_EDIT7, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 300, 52, 194, 12
CONTROL "Res.Factura", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 70, 40, 8
CONTROL "", IDC_EDIT8, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 66, 194, 12
CONTROL "Freguesia", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 260, 70, 35, 8
CONTROL "", IDC_EDIT9, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 300, 66, 194, 12
CONTROL "CPostal", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 84, 36, 8
CONTROL "", IDC_EDIT10, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 80, 194, 12
CONTROL "NIF", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 271, 84, 15, 8
CONTROL "", IDC_EDIT11, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 300, 80, 45, 12
CONTROL "BI", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 353, 84, 10, 8
CONTROL "", IDC_EDIT12, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 367, 80, 45, 12
CONTROL "Dt.BI", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 422, 84, 22, 8
CONTROL "", IDC_EDIT13, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 450, 80, 45, 12
CONTROL "Matriz", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 333, 28, 22, 8
CONTROL "", IDC_EDIT14, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 367, 24, 30, 12
CONTROL "Dt.Abertura", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 98, 40, 8
CONTROL "", IDC_EDIT15, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 58, 94, 45, 12
CONTROL "Contador", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 112, 98, 32, 8
CONTROL "", IDC_EDIT16, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 152, 94, 45, 12
CONTROL "Marca", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 209, 98, 22, 8
CONTROL "", IDC_EDIT17, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 241, 94, 60, 12
CONTROL "Ano", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 312, 98, 15, 8
CONTROL "", IDC_EDIT18, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 335, 94, 30, 12
CONTROL "Modelo", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 377, 98, 27, 8
CONTROL "", IDC_EDIT19, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 409, 94, 20, 12
CONTROL "Pressão", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 437, 98, 28, 8
CONTROL "", IDC_EDIT20, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 470, 94, 24, 12
}

SDLCLI_LISTA DIALOG 28, 73, 525, 263
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
{
CONTROL "", IDC_LISTBOX1, "LISTBOX", LBS_STANDARD, 12, 16, 421, 232
CONTROL "", IDC_GROUPBOX3, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 6, 8, 432, 246
}

Obrigado.
j.fmagalhaes
 
Posts: 14
Joined: Thu Nov 11, 2010 3:02 pm

Re: Listbox no FWH 6.2

Postby j.fmagalhaes » Sat Nov 13, 2010 2:15 pm

Obrigados
Resolvi o problema copiando nova LIB FIVEH, seguindo a informação prestada em 2009.
j.fmagalhaes
 
Posts: 14
Joined: Thu Nov 11, 2010 3:02 pm

Re: Listbox no FWH 6.2

Postby Euclides » Sun Nov 14, 2010 11:26 am

Olá, (desculpe o atrazo, mas tive que me ausentar uns dias...)
Bom que tenha resolvido.
Para encerrar, só para a sua informação:
Quando ocorre um erro (como o 1081) o sistema cria um arquivo "log" de erro na pasta do programa denominado "ERROR.LOG". Os dados iniciais do arquivo são como abaixo:
*------------------------------------------------------
Application
===========
Path and name: C:\work\PRG\gut\main.Exe (32 bits)
Size: 3,019,776 bytes
Time from start: 0 hours 0 mins 10 secs
Error occurred at: 18-02-2010, 15:26:36
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = C STAMPANTE
[ 2] = N 2

Stack Calls
===========
Called from: source\GUT210.PRG => (b)GUT210(124)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(8422)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1333)
...
(continua)
*----------------------------------------------
O erro 1081 como o nome indica é "Argument error"
(no caso... talvez, somando um campo "C" com um campo "N")
O erro ocorreu na linha 124 do programa GUT210
Por isso é que solicitei a listagem do arquivo "ERROR.LOG".
... mas já que resolveu... boa sorte na próxima!
Euclides
User avatar
Euclides
 
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm


Return to All products support

Who is online

Users browsing this forum: No registered users and 6 guests