Page 1 of 1

BtnBmp

PostPosted: Thu Mar 19, 2015 9:43 pm
by TimStone
When using a button bitmap on a dialog within a method in a class, when I end the dialog, I get an error:

tBtnBmp:New( 249 ) No exported method: NCLRTEXT

Looking at the btnbmp source, it is actually calling ::oWnd:nclrtext

Can anyone shed some light on what is happening so I can resolve this ? It is not specific to that bitmap.

Thanks for your ideas.

FWH 15.02, Harbour, MSVC 2013

Re: BtnBmp

PostPosted: Thu Mar 19, 2015 11:42 pm
by Antonio Linares
Tim,

It seems as ::oWnd is nil and it shouldn't be

Could you post the entire error.log here ? thanks

Re: BtnBmp

PostPosted: Fri Mar 20, 2015 1:44 am
by TimStone
Code: Select all  Expand view

Application
===========
   Path and name: C:\Projects VS\MLS Service Writer 10\Debug\MLS Service Writer 10.exe (32 bits)
   Size: ********* bytes
   Compiler version: Harbour 3.2.0dev (r1412151448)
   FiveWin  Version: FWH 15.02
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 39 secs
   Error occurred at: 03/19/15, 14:33:42
   Error description: Error BASE/1004  No exported method: NCLRTEXT
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => NCLRTEXT( 0 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:NEW( 249 )
   Called from: .\source\classes\WINDOW.PRG => TBTNBMP:SAVE( 1636 )
   Called from: C:\Projects\MLS2015\Source\mAPaccounts.PRG => (b)TVENDORS_FULLEDIT( 195 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 535 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 763 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1723 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1409 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3355 )
   Called from:  => DIALOGBOX( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 )
   Called from: C:\Projects\MLS2015\Source\mAPaccounts.PRG => TVENDORS:FULLEDIT( 224 )
   Called from: C:\Projects\MLS2015\Source\asw2015.prg => (b)MAIN( 363 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 535 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 763 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1723 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1409 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3355 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1057 )
   Called from: C:\Projects\MLS2015\Source\asw2015.prg => MAIN( 404 )

System
======
   CPU type: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz 75 Mhz
   Hardware memory: 12240 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 6
      1 , C:\windows\SYSTEM32\SHELL32.dll                                                                    
      2 , C:\windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17415_none_a9ed7f
      3 DDE Server Window, C:\windows\SYSTEM32\ole32.dll                                                                      
      4 GDI+ Window,                                                                                                    
      5 GDI+ Window, C:\windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17415_none_dad8722c5bcc2d
      6 Task Switching, C:\Projects VS\MLS Service Writer 10\Debug\MLS Service Writer 10.exe                                

Variables in use
================
   Procedure     Type   Value
   ==========================
   NCLRTEXT
     Param   1:    O    Class: ERROR
   TBTNBMP:NEW
     Local   1:    U    
     Local   2:    U    
   TBTNBMP:SAVE
     Local   1:    N    0
     Local   2:    N    0
     Local   3:    U    
     Local   4:    U    
     Local   5:    U    
     Local   6:    U    
     Local   7:    U    
     Local   8:    U    
     Local   9:    U    
     Local  10:    U    
     Local  11:    C    " "
     Local  12:    U    
     Local  13:    L    .F.
     Local  14:    L    .F.
     Local  15:    U    
     Local  16:    U    
     Local  17:    U    
     Local  18:    U    
     Local  19:    L    .T.
     Local  20:    C    "TOP"
     Local  21:    L    .F.
     Local  22:    U    
     Local  23:    U    
     Local  24:    L    .F.
     Local  25:    U    
     Local  26:    L    .T.
     Local  27:    U    
     Local  28:    L    .T.
     Local  29:    L    .F.
     Local  30:    S    
     Local  31:    O    Class: TBTNBMP
   (b)TVENDORS_FULLEDIT
     Local   1:    U    
     Local   2:    U    
     Local   3:    C    ""
     Local   4:    U    
     Local   5:    O    Class: TBTNBMP
     Local   6:    U    
     Local   7:    N    0
   TBTNBMP:CLICK
     Param   1:    O    Class: TBTNBMP
   TBTNBMP:LBUTTONUP
   TCONTROL:HANDLEEVENT
     Param   1:    N    29
     Param   2:    N    36
     Param   3:    N    0
     Local   1:    L    .T.
     Local   2:    S    
   TBTNBMP:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    1900580
     Local   1:    U    
   _FWH
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    1900580
   DIALOGBOX
     Param   1:    N    1900580
     Param   2:    N    514
     Param   3:    N    0
     Param   4:    N    1900580
     Param   5:    N    76
     Local   1:    O    Class: TBTNBMP
   TDIALOG:ACTIVATE
     Param   1:    N    3211264
     Param   2:    C    "PRO5210W"
     Param   3:    N    7146848
     Param   4:    O    Class: TDIALOG
   TVENDORS:FULLEDIT
     Param   1:    U    
     Param   2:    U    
     Param   3:    U    
     Param   4:    L    .F.
     Param   5:    U    
     Param   6:    L    .T.
     Param   7:    B    {|| ... }
     Param   8:    U    
     Param   9:    U    
     Param  10:    L    .F.
     Param  11:    L    .F.
     Local   1:    N    7146848
     Local   2:    S    
     Local   3:    O    Class: TDIALOG
   (b)MAIN
     Local   1:    O    Class: TVENDORS
     Local   2:    A    Len:  163
     Local   3:    A    Len:  249
     Local   4:    A    Len:   65
   TBTNBMP:CLICK
     Param   1:    O    Class: TBTNBMP
   TBTNBMP:LBUTTONUP
   TCONTROL:HANDLEEVENT
     Param   1:    N    55
     Param   2:    N    22
     Param   3:    N    0
     Local   1:    L    .T.
     Local   2:    S    
   TBTNBMP:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    3604502
     Local   1:    U    
   _FWH
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    3604502
   WINRUN
     Param   1:    N    3604502
     Param   2:    N    514
     Param   3:    N    0
     Param   4:    N    3604502
     Param   5:    N    9
     Local   1:    O    Class: TBTNBMP
   TWINDOW:ACTIVATE
     Param   1:    N    7146848
   MAIN
     Param   1:    C    "MAXIMIZED"
     Param   2:    U    
     Param   3:    U    
     Param   4:    U    
     Param   5:    U    
     Param   6:    B    {|| ... }
     Param   7:    U    
     Param   8:    U    
     Param   9:    U    
     Param  10:    U    
     Param  11:    U    
     Param  12:    U    
     Param  13:    U    
     Param  14:    U    
     Param  15:    U    
     Param  16:    U    
     Param  17:    B    {|| ... }
     Param  18:    U    
     Param  19:    U    
     Param  20:    L    .F.
     Local   1:    O    Class: TWINDOW
     Local   2:    U    
     Local   3:    U    

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFCDX
   DBFNTX
   ADS
   ADSADT
   ADSVFP
   ADSCDX
   ADSNTX

DataBases in use
================

  1: => DB001                              RddName: ADSCDX
     ==============================
     RecNo    RecCount    BOF   EOF
        169          228      .F.   .F.

     Indexes in use                        TagName
           acpnum                             AAPVEN
        => upper(acpcom)                      AAPCOM

     Relations in use

  2:    DB002                              RddName: ADSCDX
     ==============================
     RecNo    RecCount    BOF   EOF
        186          185      .F.   .T.

     Indexes in use                        TagName
        => acpnum                             AAPTRN
           acpnum+DTOS(acppdt)                AAPTRD
           acpnum+acpinv                      AAPTRR

     Relations in use

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TCALC
     5 TFONT
     6 TDATABASE
     7 TDATA
     8 TCONFIG
     9 TBRUSH
    10 TWINDOW
    11 TCONTROL
    12 TBITMAP
    13 TDIALOG
    14 TGET
    15 GET
    16 TCLIPGET
    17 TBTNBMP
    18 TRECT
    19 TICON
    20 TMENU
    21 TMENUITEM
    22 TBAR
    23 TMSGBAR
    24 TMSGITEM
    25 TTIMER
    26 TVENDORS
    27 TLEDGER
    28 TVENDORDATA
    29 TCOMBOBOX
    30 TMULTIGET
    31 TXBROWSE
    32 TXBRWCOLUMN
    33 TBUTTON
    34 TBUTTONBMP
    35 TSCROLLBAR
    36 TREG32

Memory Analysis
===============
      762 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes


 

Re: BtnBmp

PostPosted: Fri Mar 20, 2015 6:29 am
by Antonio Linares
Tim,

As I guesssed, oWnd is nil.

Please show here the source code line contents where you create that BtnBmp, thanks

Re: BtnBmp

PostPosted: Fri Mar 20, 2015 1:16 pm
by nageswaragunupudi
Did you by any chance have a code like:

Code: Select all  Expand view
@ r,c, BTNBMP oBtn ............... ACTION ::Save()


This does not get translated as <yourclass>:Save() but gets translated as oBtn:Save()

Re: BtnBmp

PostPosted: Fri Mar 20, 2015 2:23 pm
by James Bott
Tim,

If you are doing what Rao said, and if ::save() is a method of a TData or TRecord subclass, then you should not be making user interface code as part of the subclass, but rather passing the data object to the UI code. Remember that data objects should be models of real-world objects (e.g. customers, parts, etc.) and thus should not contain UI code.

If that is not what you are doing, then ignore everything I just said.

James

Re: BtnBmp

PostPosted: Fri Mar 20, 2015 3:44 pm
by TimStone
Rao,

That resolved it. Thanks.

James,

The older I get, the less perfect I see the "real world".

I have separate data and interface classes. It's all part of my cleanup strategy and it works nicely.

To me, a user interface should no longer be a function, it should be a class. I've got so many functions that do essentially the same task, so all of those are being condensed into one for like actions. The code base is getting smaller and far more manageable.

Tim