MsgInfo(Len(oDlg:GetRect()))return array with 5 elements and first is NIL
(that was not case in 16 bit version)
MsgInfo(Len(GetWndRect(oDlg:hWnd)))return array with 4 elements and it is ok
Best regrads,
MsgInfo(Len(oDlg:GetRect()))MsgInfo(Len(GetWndRect(oDlg:hWnd)))GetRect() method returns an array of 4 items. Please look inside window.prg. Probably you are using a modified version of TWindow.
EMG
#include "FiveWin.ch"
function Main()
local oDlg
DEFINE DIALOG oDlg TITLE "Test"
@ 5, 5 BUTTON "&oDlg:GetRect()" OF oDlg SIZE 80, 12 PIXEL ;
ACTION MsgInfo( LEN(oDlg:GetRect()) )
@ 25, 5 BUTTON "&GetWndRect(oDlg:hWnd)" OF oDlg SIZE 80, 12 PIXEL ;
ACTION MsgInfo( LEN(GetWndRect(oDlg:hWnd)) )
ACTIVATE DIALOG oDlg CENTERED
return nil
Sorry, my fault. GetRect() method returns a TRect object not an array.
EMG
#include "FiveWin.ch"
//-------------
function Main()
local oDlgMain
DEFINE DIALOG oDlgMain FROM 0,0 to 200,200 PIXEL ;
TITLE "Dialog 1"
@ 5, 5 BUTTON "&New Dialog" OF oDlgMain SIZE 80, 12 PIXEL ;
ACTION NewDlg( oDlgMain )
ACTIVATE DIALOG oDlgMain
return nil
//-----------------------
function NewDlg(oDlgMain)
local oDlg
local Coordinates := oDlgMain:GetRect()
DEFINE DIALOG oDlg FROM Coordinates[1]+100,Coordinates[2]+100 ;
TO Coordinates[3]+100,Coordinates[4]+100 ;
PIXEL ;
TITLE "Dialog 2"
ACTIVATE DIALOG oDlg
return nil
What is exactly the problem? Your sample seems to work fine here.
EMG
Path and name: E:\FWH\samples\testrect.exe (32 bits)
Size: 1,550,848 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 01/30/12, 20:08:24
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = U
[ 2] = N 100
Called from: testrect.prg => NEWDLG(27)
Called from: testrect.prg => (b)MAIN(12)
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176)
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1447)
Called from: .\source\classes\WINDOW.PRG => _FWH(3409)
Called from: => SENDMESSAGE(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(933)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: testrect.prg => MAIN(14)
If i test:
MsgInfo(Len(oDlgMain:GetRect())) return 5
First item is NIL and items 2,3,4,5 are the values of coordinates.
Regards,
As I said, it works fine here (FWH 11.11).
EMG
Also works fine here with FWH 12.01 ![]()