FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET MEMO command error?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
GET MEMO command error?
Posted: Fri Sep 05, 2008 08:30 PM
Dear Antonio,

I have used following code for normal GET. I work fine but when I use the same with MEMO field. It is not working and show this error.
*--------------------------------*
Procedure MakeGet(oGet,aMField,Nr,aStruct)
// aMField := {151,'TBL->TBL_MEMO'}
// aStruct := {{'TBL_MEMO','M',10,0}}
if aStruct[ascan( aStruct , {|x| x[1]=right(aMField[Nr,2],len(aMField[Nr,2])-5) } )][2] = 'M'

REDEFINE GET oGet[Nr] VAR &(MEMVAR->aMField[Nr,2]) ;	
               MEMO ;
               ID MEMVAR->aMField[Nr,1]
else
REDEFINE GET oGet[Nr] VAR &(MEMVAR->aMField[Nr,2]) ;	
               ID MEMVAR->aMField[Nr,1]
end
return


    Error description: Error Objects/8  No Object Msg.: UNDEFINED:DEFCONTROL

Stack Calls
===========
   Called from LOCKERRHAN(0)
   Called from (b)INITHANDL$(0)
   Called from DEFCONTROL(0)
   Called from TMULTIGET:REDEFINE(0)
   Called from MAKEGET(1216)
   .....


.DLL file

 EDITTEXT 151, 342, 150, 59, 30, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP

If I remark MEMO line. I show ok but I cannot try multiline text as usaul.

Regards,
Dutch
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
GET MEMO command error?
Posted: Fri Sep 05, 2008 09:07 PM

Dutch,

It looks like it is erroring out on this line of the Redefine method:

oWnd:DefControl( Self )

I think you need to add the OF oWnd clause.

TGet's oWnd defaults to GetWndDefault() but that is not really what you want either. TMultiGet doesn't have a default oWnd, thus the error. You should always specify the OF oWnd clause for all your controls.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
GET MEMO command error?
Posted: Sat Sep 06, 2008 03:24 PM

Dear James,

You answer is the correct point, it works correctly.

Thanks&regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
GET MEMO command error?
Posted: Sat Sep 06, 2008 03:31 PM

Dutch, James,

We have included DEFAULT oWnd := GetWndDefault() in Method Redefine() for next build, thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
GET MEMO command error?
Posted: Sat Sep 06, 2008 05:11 PM

Antonio,

>We have included DEFAULT oWnd := GetWndDefault() in Method Redefine() for next build

I wonder if it wouldn't be better to let it error out? If it defaults to the wrong window as the parent it may even be harder to find the problem. What would the consequences be if it has the wrong parent window?

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
GET MEMO command error?
Posted: Sat Sep 06, 2008 11:42 PM

James,

A REDEFINE is always issued after a DEFINE DIALOG ..., and DEFINE DIALOG sets the default parent window.

Of course it is much better to specify OF oDlg, but if the programmer forgets it, FWH takes care of it.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion