xBrowse with resource file

xBrowse with resource file

Postby reds » Wed May 15, 2019 4:44 pm

What am I doing wrong

Regards
Peter

Error description: Error FiveWin/2 Duplicated Id: No: 101

Stack Calls
===========
Called from: .\source\classes\DIALOG.PRG => TDIALOG:DEFCONTROL( 366 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CREATEFROMCODE( 1122 )
Called from: C:\_WA\RESTEST1.prg => MAIN( 15 )

Code: Select all  Expand view


#include 'fivewin.ch'
#include 'xbrowse.ch'
     
function main()

   LOCAL oDlg, oBrw,oBtn2

  USE CUSTOMER NEW ALIAS "CUST"
   
     DEFINE DIALOG oDlg RESOURCE  "IDD_DIALOG1"
   
       REDEFINE XBROWSE oBrw  ID 4002  OF oDlg COLUMNS "First", "City", "State"  ;
                  LINES CELL FASTEDIT DATASOURCE "CUST"
 
   oBrw:CreateFromCode()
     
   REDEFINE  BUTTON oBtn2  ID 4001  of oDlg   ACTION oDlg:End()    
   ACTIVATE DIALOG oDlg CENTERED

return nil


Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 8.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"

LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL

IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 535, 270
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|DS_CENTER|WS_CAPTION|WS_SYSMENU|WS_VISIBLE|0x00000008
CAPTION "Dialog"
FONT 8, "Ms Shell Dlg"
{
  CONTROL "Exit", 4001, "Button", WS_TABSTOP, 450, 245, 50, 14
  CONTROL "", 4002, "TXBrowse", WS_TABSTOP|0x00200000, 25, 5, 495, 210
}

 
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: xBrowse with resource file

Postby richard-service » Wed May 15, 2019 5:28 pm

reds wrote:What am I doing wrong

Regards
Peter

Error description: Error FiveWin/2 Duplicated Id: No: 101

Stack Calls
===========
Called from: .\source\classes\DIALOG.PRG => TDIALOG:DEFCONTROL( 366 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CREATEFROMCODE( 1122 )
Called from: C:\_WA\RESTEST1.prg => MAIN( 15 )

Code: Select all  Expand view


#include 'fivewin.ch'
#include 'xbrowse.ch'
     
function main()

   LOCAL oDlg, oBrw,oBtn2

  USE CUSTOMER NEW ALIAS "CUST"
   
     DEFINE DIALOG oDlg RESOURCE  "IDD_DIALOG1"
   
       REDEFINE XBROWSE oBrw  ID 4002  OF oDlg COLUMNS "First", "City", "State"  ;
                  LINES CELL FASTEDIT DATASOURCE "CUST"
 
   oBrw:CreateFromCode()
     
   REDEFINE  BUTTON oBtn2  ID 4001  of oDlg   ACTION oDlg:End()    
   ACTIVATE DIALOG oDlg CENTERED

return nil


Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 8.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"

LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL

IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 535, 270
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|DS_CENTER|WS_CAPTION|WS_SYSMENU|WS_VISIBLE|0x00000008
CAPTION "Dialog"
FONT 8, "Ms Shell Dlg"
{
  CONTROL "Exit", 4001, "Button", WS_TABSTOP, 450, 245, 50, 14
  CONTROL "", 4002, "TXBrowse", WS_TABSTOP|0x00200000, 25, 5, 495, 210
}

 


I use another
Code: Select all  Expand view

::oBrw := TXBrowse():New( ::oDlg )

::oCol := ::oBrw:AddCol()
::oCol:cHeader       := "客戶類別編號"
::oCol:nHeadStrAlign := AL_CENTER
::oCol:bStrData      := { || ::oDB:CUSTTY_NO }
::oCol:nWidth        := 150

::oBrw:CreateFromResource( ID )
 
Last edited by richard-service on Thu May 16, 2019 5:09 pm, edited 1 time in total.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: xBrowse with resource file

Postby nageswaragunupudi » Wed May 15, 2019 5:33 pm

No please.

Just remove the line

Code: Select all  Expand view

  oBrw:CreateFromCode()
 


Do NOT add oBrw:CreateFromResource()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse with resource file

Postby reds » Fri May 17, 2019 7:58 am

Thanks

too busy checking for resource errors to notice the obvious error :-)

Regards
Peter
reds
 
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 118 guests