exe run's from xmate , not stand alone

exe run's from xmate , not stand alone

Postby Demont Brecht » Tue Mar 20, 2012 9:46 am

Hello,

After two month from conversion from fxh8.10 and xhb comercial to fwh12.02 and bcc582 , i try the final version.

Building the aplication with xmate , it works fine.

When the exe-file is launched from the command line , the aplication freezes on the paint clausule from the main window :

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( Start_Hen(DataDir , oWnd , bStart ) ) ;
/*
ON PAINT ( BmpTiled( hDC , oBmpTiled ),;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 2 ) - ( oBmp:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oBmp:nWidth() / 2 ), oBmp:hBitmap ) ) /*,;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 4 ) - ( oImage:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oImage:nWidth() / 2 ), oImage:hBitmap ) )*/
*/

I have no idea why the exe works launched from xmate , not launched from the command line

Frank
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: exe run's from xmate , not stand alone

Postby Antonio Linares » Tue Mar 20, 2012 10:16 am

Frank,

have you checked that those bitmaps are properly loaded ? Maybe you are running the app from different paths

Try this:

MsgInfo( oBmpTiled:hBitmap )
MsgInfo( oBmp:hBitmap )
MsgInfo( oImage:hBitmap )

Those values should not be zero
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42087
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: exe run's from xmate , not stand alone

Postby Demont Brecht » Tue Mar 20, 2012 10:54 am

Antonio ,

Thank you very much for your answer.

I had some problems with GetCurDir and changed as :
# ifdef FWH12
LOCAL cDir := GetCurDir() + "\"
IF ! (cDir=CurDrive()+":\")
cDir := CurDrive() + ":\" + GetCurDir() + "\"
END
# else
LOCAL cDir := CurDrive() + ":\" + GetCurDir() + "\"
# endif

In the new environnement GetCurDir seems to give a different result , maybe xbuild launched the aplication on a different way as xmate

Now the result from cDir , launched from command line is b:\B:\henwin , confusion between b: and B: , using UPPER(..) solves the problem !!!!!

Frank
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: exe run's from xmate , not stand alone

Postby ukoenig » Tue Mar 20, 2012 11:56 am

Frank,

I always use without any Problems :

c_path := GETCURDIR()

// use in older FWH-versions !!!
// c_path := CURDRIVE() + ":\" + GETCURDIR()

A image call :

DEFINE IMAGE oImage FILE c_path + "\Images\Logo.bmp"

or a Button :

@ 5, 110 BTNBMP oWBtn5 OF oGrpD1 ;
SIZE 130, 55 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Save to INI" ;
FILENAME c_path + "\Images\Save.Bmp" ;
ACTION SAVE_INI() ;
FONT oDataFont ;
LEFT
oWBtn5:lTransparent := .t.
oWBtn5:cToolTip = { "Save " + CRLF + "Values","SAVE", 1, CLR_BLACK, 14089979 }
oWBtn5:SetColor( 0, )

---------------------------

It seems, You want to display a centered Logo ?
From Your Test :

ON PAINT ( BmpTiled( hDC , oBmpTiled ),;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 2 ) - ( oBmp:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oBmp:nWidth() / 2 ), oBmp:hBitmap ) ) /*,;
PalBmpDraw( hDC,;
( oWnd:nHeight() / 4 ) - ( oImage:nHeight() / 2 ) - 50,;
( oWnd:nWidth() / 2 ) - ( oImage:nWidth() / 2 ), oImage:hBitmap ) )*/


I nearly finished my new Logopainter ( includes a LOGO- and DIALOG-part )

What You can do :

LOGO-part
-------------
1. select any Logo
2. paint and test on any Window-background
3. move and resize
4. calculates and paints on centered Position
5. creates a working external EXE-file
6. everything works at Runtime
7. A Collection of some nice Logo-templates are included, to use as Basic, creating Your own Logo.

DIALOG-part
---------------
1. select any Dialog-background
2. test TFolderEx-transparent-painting with different Brushes in any combinationon with Dialog-backgrounds
3. transparent-painting-test of Controls inside TFolderEx and Dialog like Groups, Radios, Says ...
4. Create Gradients, Color, Brush and Image-selection.
5. Select Dialog from Code or Resource.

Image

Selections :
Image

Dialog :
Image

a LOGO-Sample of a created PRG from the Tool :

Code: Select all  Expand view

#include "FiveWin.ch"
#include "Image.ch"

STATIC hDC, oWnd, oDlg, oFont

FUNCTION Main()
LOCAL oBtn1, oBtn2
LOCAL nSWidth := GetSysMetrics(0), nSHeight := GetSysMetrics(1)

SET _3DLOOK ON
SetBalloon( .T. )
c_path := GETCURDIR()
// use in older FWH-versions
// c_path := CURDRIVE() + ":\" + GETCURDIR()

DEFINE ICON oIco RESOURCE "Super"
oFont := TFont():New("Arial",0,-14,.F.,.T.,0,0,0,.T. )

DEFINE WINDOW oWnd  ;
TITLE "Window / Dialog - Brushes and Logos"   MENU TMenu():New()

@ nSHeight - 158, nSWidth - 100 BTNBMP oBtn1 OF oWnd ;
SIZE 80, 70 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Exit" ;
FILENAME c_path + "\Images\Exit.Bmp" ;
ACTION oWnd:End() ;
FONT oFont ;
TOP
oBtn1:lTransparent := .t.
oBtn1:cToolTip =  { "Exit " + CRLF + "Codetester","EXIT", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )

SET MESSAGE OF oWnd TO "Window / Dialog - Brushes and Logos" ;
CENTERED CLOCK KEYBOARD 2007

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE ( W_BACKGRD( oWnd, "PICTURE8.jpg" ), ;
          PAINT_LOGO() )

SET _3DLOOK OFF
oFont:End()

RETURN NIL 

// --------  WINDOW - Background ---------------

FUNCTION W_BACKGRD( oWnd, cImage )
LOCAL oBrush
DEFINE IMAGE oImage FILE c_path + "\Images\" + cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oWnd:nWidth, oWnd:nHeight , .T. ) )
oImage:End()
oWnd:SetBrush( oBrush )
oBrush:End()

RETURN( NIL )

// ------- LOGO ---------------

FUNCTION PAINT_LOGO()

@ 221.5, 319.0 IMAGE oLogo ;
FILENAME c_Path + "
\Images\Logo7.bmp" ;
NOBORDER ;
SIZE 402, 311 ;
OF oWnd ;
PIXEL ;
ADJUST ;
TRANSPARENT

oLogo:bRClicked := {|| MsgAlert( ( "
Top : " + ALLTRIM(STR(oLogo:nTop())) + CRLF + ;
                               "
Left : " + ALLTRIM(STR(oLogo:nLeft())) + CRLF + ;
                               "
Width : " + ALLTRIM(STR(oLogo:nWidth())) + CRLF + ;
                               "
Height : " + ALLTRIM(STR(oLogo:nHeight())) ), "Logo - Pos. and Size" ) }

RETURN ( NIL )


The Result of the created PRG : a Standalone EXE-file, compiled from inside the Tool
The needed LOGO-Top / Left for the centered Position is calculated and added to the PRG.

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

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