#include <fivewin.ch>
********** TEST CODE **********
proc main
LOCAL oWnd, oGif
DEFINE WINDOW oWnd TITLE "3D objects"
oGif := GifControl():New(10,10,oWnd,,,"segu0020.gif")
oGif := GifControl():New(10,100,oWnd,100,100,"TEST_GIF")
oGif := GifControl():New(10,200,oWnd,,,"TEST_GIF")
oGif:lUseDoubleBuffer := .T. // necessary for transparent gif
ACTIVATE WINDOW oWnd
*******************************
********* GifControl **********
#define COLOR_WINDOW 5
#define COLOR_BTNFACE 15
#define SRCCOPY 0xCC0020
class GifControl FROM TControl
CLASSDATA lRegistered AS LOGICAL
DATA oImage
DATA hGlobal //used in case of load from resource
DATA aFrameLen
DATA oTimer
DATA nCurrFrame
DATA lUseDoubleBuffer INIT .F.
METHOD New( nRow, nCol, oWnd, nWidth, nHeight, szFileName ) CONSTRUCTOR
METHOD Display() INLINE ::BeginPaint(),::Paint(),::EndPaint(),0
METHOD Paint()
METHOD ChangeFrame()
METHOD Destroy()
endclass
METHOD New( nRow, nCol, oWnd, nWidth, nHeight, szFileName, nClrPane ) class GifControl
::oImage := GDIBmp():New()
if file(szFileName)
::oImage:hBmp := GDIPlusImageFromFile(szFileName)
else
::hGlobal := CopyResourceInGlobal(GetResources(),szFileName, 10)
::oImage:hBmp := GDIPlusImageFromGlobal(::hGlobal)
endif
::aFrameLen := GdiPlusImageGetFrameDimensions(::oImage:hBmp)
DEFAULT nRow := 10, nCol := 10, oWnd := GetWndDefault()
DEFAULT nWidth := ::oImage:GetWidth()-1
DEFAULT nHeight := ::oImage:GetHeight()-1
::oWnd := oWnd
::nId := ::GetNewId()
::nStyle := nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP )
::nTop := nRow
::nLeft := nCol
::nBottom := ::nTop + nHeight - 1
::nRight := ::nLeft + nWidth
if empty(nClrPane)
//::nClrPane := GetSysColor( COLOR_WINDOW )
//::nClrPane := GetSysColor(COLOR_BTNFACE)
::nClrPane := iif(Upper( oWnd:Classname() ) != "TWINDOW",;
GetSysColor( COLOR_BTNFACE ),;
oWnd:nClrPane)
endif
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
::oBrush := TBrush():New( , ::nClrPane )
::Create()
oWnd:AddControl( Self )
::nCurrFrame := -1
::ChangeFrame()
return Self
METHOD Destroy()
::Super:Destroy()
if .not. empty(::hGlobal)
GlobalFree(::hGlobal)
::hGlobal:=nil
endif
if .not. empty(::oImage)
//is it necessary? it has the destroyer...
::oImage:Destroy()
endif
if .not. empty(::oTimer)
::oTimer:Destroy()
endif
return nil
METHOD Paint() class GifControl
local aRect := GetClientRect( ::hWnd )
local hDCMem, hBmpMem
local hOldBmp
LOCAL g
if ::lUseDoubleBuffer
hDCMem = CreateCompatibleDC( ::hDC )
hBmpMem = CreateCompatibleBitmap( ::hDC, aRect[ 4 ], aRect[ 3 ] )
hOldBmp = SelectObject( hDCMem, hBmpMem )
g := Graphics():New(hDCMem)
FillRect( hDCMem, aRect, ::oBrush:hBrush )
else
g := Graphics():New(::hDC)
endif
g:DrawImage(::oImage,0,0,aRect[ 4 ], aRect[ 3 ] )
g:Destroy()
if ::lUseDoubleBuffer
BitBlt( ::hDC, 0, 0, aRect[4], aRect[3], hDCMem, 0, 0, SRCCOPY )
SelectObject( hDCMem, hOldBmp )
DeleteObject( hBmpMem )
DeleteDC( hDCMem )
endif
return nil
METHOD ChangeFrame() class GifControl
LOCAL cS := Self
::nCurrFrame++
//? ::nCurrFrame
if empty(::aFrameLen)
return
endif
if ::nCurrFrame == len(::aFrameLen)
::nCurrFrame := 0
endif
GdiPlusImageSelectActiveFrame(::oImage:hBmp,::nCurrFrame)
if empty(::oTimer)
DEFINE TIMER ::oTimer ;
INTERVAL ::aFrameLen[::nCurrFrame+1] ;
ACTION cS:ChangeFrame() ;
OF Self
else
::oTimer:DeActivate()
endif
::oTimer:nInterval := ::aFrameLen[::nCurrFrame+1]
::oTimer:Activate()
::Refresh(.F.)
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <Windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
HB_FUNC( GDIPLUSIMAGEFROMFILE )
{
wchar_t *cFileName = hb_mbtowc( hb_parc(1) );
Image* pImage = Image::FromFile(cFileName);
hb_xfree( cFileName );
hb_retptr(pImage);
}
HB_FUNC( COPYRESOURCEINGLOBAL )
{
HINSTANCE hInst = ( HINSTANCE ) hb_parnl( 1 );
HRSRC hResource = FindResource(hInst, hb_parc(2), MAKEINTRESOURCE( hb_parni( 3 ) ));
if (!hResource) { hb_ret(); return; }
DWORD imageSize = SizeofResource(hInst, hResource);
if (!imageSize) { hb_ret(); return; }
const void* pResourceData = LockResource(LoadResource(hInst, hResource));
if (!pResourceData) { hb_ret(); return; }
HANDLE hBuffer = GlobalAlloc(GMEM_MOVEABLE, imageSize);
if (hBuffer)
{
void* pBuffer = GlobalLock(hBuffer);
if (pBuffer)
{
memcpy(pBuffer, pResourceData, imageSize);
GlobalUnlock(hBuffer);
}
}
#ifndef _WIN64
hb_retnl((long)hBuffer);
#else
hb_parnll((long long)hBuffer);
#endif
}
HB_FUNC( GDIPLUSIMAGEFROMGLOBAL )
{
#ifndef _WIN64
HGLOBAL hBuffer = ( HGLOBAL ) hb_parnl( 1 );
#else
HGLOBAL hBuffer = ( HGLOBAL ) hb_parnll( 1 );
#endif
IStream* pStream = NULL;
Image* pImage = 0;
if (CreateStreamOnHGlobal(hBuffer, TRUE, &pStream) == S_OK)
{
pImage = Image::FromStream(pStream);
pStream->Release();
}
hb_retptr(pImage);
}
HB_FUNC( GDIPLUSIMAGEGETFRAMEDIMENSIONS )
{
Image* pImage = (Image*)hb_parptr(1);
UINT nFrame = pImage->GetFrameDimensionsCount();
GUID g;
if(nFrame == 0)
{
hb_ret();
return;
}
pImage->GetFrameDimensionsList(&g,1);
nFrame = pImage->GetFrameCount(&g);
hb_reta(nFrame);
UINT nSize = pImage->GetPropertyItemSize(PropertyTagFrameDelay);
PropertyItem* pPropertyItem = (PropertyItem*) malloc(nSize);
pImage->GetPropertyItem(PropertyTagFrameDelay, nSize, pPropertyItem);
for(UINT i=0;i<nFrame;i++)
{
hb_storvni( ((UINT*)pPropertyItem[0].value)[i] * 10 , -1, i+1 );
}
free(pPropertyItem);
}
HB_FUNC( GDIPLUSIMAGESELECTACTIVEFRAME )
{
Image* pImage = (Image*)hb_parptr(1);
GUID g = FrameDimensionTime;
pImage->SelectActiveFrame(&g, hb_parni(2));
hb_ret();
}
HB_FUNC( MYDRAW )
{
Graphics g((HDC)hb_parnl(1));
Image* i = (Image*)hb_parptr(2);
g.DrawImage(i,0,0,i->GetWidth(),i->GetHeight());
}
#pragma ENDDUMP
#include <fivewin.ch>
********** TEST CODE **********
proc main
LOCAL oWnd, oGif
DEFINE DIALOG oWnd TITLE "3D objects"
oGif := GifControl():New(10,10,oWnd,,,"segu0020.gif")
oGif := GifControl():New(10,100,oWnd,100,100,"TEST_GIF")
oGif := GifControl():New(10,200,oWnd,,,"TEST_GIF")
oGif:lUseDoubleBuffer := .T. // necessary for transparent gif
ACTIVATE DIALOG oWnd
*******************************
********* GifControl **********
#define COLOR_BTNFACE 15
#define SRCCOPY 0xCC0020
class GifControl FROM TControl
CLASSDATA lRegistered AS LOGICAL
DATA oImage
DATA hGlobal //used in case of load from resource
DATA aFrameLen
DATA oTimer
DATA nCurrFrame
DATA lUseDoubleBuffer INIT .F.
METHOD New( nRow, nCol, oWnd, nWidth, nHeight, szFileName ) CONSTRUCTOR
METHOD Display() INLINE ::BeginPaint(),::Paint(),::EndPaint(),0
METHOD Paint()
METHOD Initiate( hDlg )
METHOD ChangeFrame()
METHOD Destroy()
endclass
METHOD New( nRow, nCol, oWnd, nWidth, nHeight, szFileName, nClrPane ) class GifControl
::oImage := GDIBmp():New()
if file(szFileName)
::oImage:hBmp := GDIPlusImageFromFile(szFileName)
else
::hGlobal := CopyResourceInGlobal(GetResources(),szFileName, 10)
::oImage:hBmp := GDIPlusImageFromGlobal(::hGlobal)
endif
::aFrameLen := GdiPlusImageGetFrameDimensions(::oImage:hBmp)
DEFAULT nRow := 10, nCol := 10, oWnd := GetWndDefault()
DEFAULT nWidth := ::oImage:GetWidth()-1
DEFAULT nHeight := ::oImage:GetHeight()-1
::oWnd := oWnd
::nId := ::GetNewId()
::nStyle := nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP )
::nTop := nRow
::nLeft := nCol
::nBottom := ::nTop + nHeight - 1
::nRight := ::nLeft + nWidth
if empty(nClrPane)
::nClrPane := iif(Upper( oWnd:Classname() ) != "TWINDOW",;
GetSysColor( COLOR_BTNFACE ),;
oWnd:nClrPane)
endif
::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
::oBrush := TBrush():New( , ::nClrPane )
::nCurrFrame := -1
if ! Empty( oWnd:hWnd )
::Create( )
oWnd:AddControl( Self )
::ChangeFrame()
else
oWnd:DefControl( Self )
// In this case?
endif
return Self
METHOD Initiate( hDlg ) class GifControl
::Super:Initiate( hDlg )
::ChangeFrame()
return nil
METHOD Destroy() class GifControl
::Super:Destroy()
if .not. empty(::hGlobal)
GlobalFree(::hGlobal)
::hGlobal:=nil
endif
if .not. empty(::oImage)
::oImage:Destroy()
endif
if .not. empty(::oTimer)
::oTimer:End()
endif
return nil
METHOD Paint() class GifControl
local aRect := GetClientRect( ::hWnd )
local hDCMem, hBmpMem
local hOldBmp
LOCAL g
if ::lUseDoubleBuffer
hDCMem = CreateCompatibleDC( ::hDC )
hBmpMem = CreateCompatibleBitmap( ::hDC, aRect[ 4 ], aRect[ 3 ] )
hOldBmp = SelectObject( hDCMem, hBmpMem )
g := Graphics():New(hDCMem)
FillRect( hDCMem, aRect, ::oBrush:hBrush )
else
g := Graphics():New(::hDC)
endif
g:DrawImage(::oImage,0,0,aRect[ 4 ], aRect[ 3 ] )
g:Destroy()
if ::lUseDoubleBuffer
BitBlt( ::hDC, 0, 0, aRect[4], aRect[3], hDCMem, 0, 0, SRCCOPY )
SelectObject( hDCMem, hOldBmp )
DeleteObject( hBmpMem )
DeleteDC( hDCMem )
endif
return nil
METHOD ChangeFrame() class GifControl
LOCAL cS := Self
::nCurrFrame++
//? ::nCurrFrame
if empty(::aFrameLen)
return nil
endif
if ::nCurrFrame == len(::aFrameLen)
::nCurrFrame := 0
endif
GdiPlusImageSelectActiveFrame(::oImage:hBmp,::nCurrFrame)
if empty(::oTimer)
DEFINE TIMER ::oTimer ;
INTERVAL ::aFrameLen[::nCurrFrame+1] ;
ACTION cS:ChangeFrame() ;
OF Self
else
::oTimer:DeActivate()
endif
::oTimer:nInterval := ::aFrameLen[::nCurrFrame+1]
::oTimer:Activate()
::Refresh(.F.)
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <Windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
HB_FUNC( GDIPLUSIMAGEFROMFILE )
{
wchar_t *cFileName = hb_mbtowc( hb_parc(1) );
Image* pImage = Image::FromFile(cFileName);
hb_xfree( cFileName );
hb_retptr(pImage);
}
HB_FUNC( COPYRESOURCEINGLOBAL )
{
HINSTANCE hInst = ( HINSTANCE ) hb_parnl( 1 );
HRSRC hResource = FindResource(hInst, hb_parc(2), MAKEINTRESOURCE( hb_parni( 3 ) ));
if (!hResource) { hb_ret(); return; }
DWORD imageSize = SizeofResource(hInst, hResource);
if (!imageSize) { hb_ret(); return; }
const void* pResourceData = LockResource(LoadResource(hInst, hResource));
if (!pResourceData) { hb_ret(); return; }
HANDLE hBuffer = GlobalAlloc(GMEM_MOVEABLE, imageSize);
if (hBuffer)
{
void* pBuffer = GlobalLock(hBuffer);
if (pBuffer)
{
memcpy(pBuffer, pResourceData, imageSize);
GlobalUnlock(hBuffer);
}
}
#ifndef _WIN64
hb_retnl((long)hBuffer);
#else
hb_parnll((long long)hBuffer);
#endif
}
HB_FUNC( GDIPLUSIMAGEFROMGLOBAL )
{
#ifndef _WIN64
HGLOBAL hBuffer = ( HGLOBAL ) hb_parnl( 1 );
#else
HGLOBAL hBuffer = ( HGLOBAL ) hb_parnll( 1 );
#endif
IStream* pStream = NULL;
Image* pImage = 0;
if (CreateStreamOnHGlobal(hBuffer, TRUE, &pStream) == S_OK)
{
pImage = Image::FromStream(pStream);
pStream->Release();
}
hb_retptr(pImage);
}
HB_FUNC( GDIPLUSIMAGEGETFRAMEDIMENSIONS )
{
Image* pImage = (Image*)hb_parptr(1);
UINT nFrame = pImage->GetFrameDimensionsCount();
GUID g;
if(nFrame == 0)
{
hb_ret();
return;
}
pImage->GetFrameDimensionsList(&g,1);
nFrame = pImage->GetFrameCount(&g);
hb_reta(nFrame);
UINT nSize = pImage->GetPropertyItemSize(PropertyTagFrameDelay);
PropertyItem* pPropertyItem = (PropertyItem*) malloc(nSize);
pImage->GetPropertyItem(PropertyTagFrameDelay, nSize, pPropertyItem);
for(UINT i=0;i<nFrame;i++)
{
hb_storvni( ((UINT*)pPropertyItem[0].value)[i] * 10 , -1, i+1 );
}
free(pPropertyItem);
}
HB_FUNC( GDIPLUSIMAGESELECTACTIVEFRAME )
{
Image* pImage = (Image*)hb_parptr(1);
GUID g = FrameDimensionTime;
pImage->SelectActiveFrame(&g, hb_parni(2));
hb_ret();
}
HB_FUNC( MYDRAW )
{
Graphics g((HDC)hb_parnl(1));
Image* i = (Image*)hb_parptr(2);
g.DrawImage(i,0,0,i->GetWidth(),i->GetHeight());
}
#pragma ENDDUMP
marca wrote:I use xHarbour and am not able to compile. It gives a lot of mistakes.
Enrico Maria Giordano wrote:marca wrote:I use xHarbour and am not able to compile. It gives a lot of mistakes.
You have to compile it in C++ mode.
EMG
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ FiveWin for xHarbour 17.01 - Jan. 2017 xHarbour development power ³Ü
³ (c) FiveTech 1993-2017 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20170215)
Copyright 1999-2017, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'testgif7.prg' and generating preprocessed output to 'testgif7.ppo'...
Done.
Lines 164, Functions/Procedures 7, pCodes 950
Embarcadero C++ 7.30 for Win32 Copyright (c) 1993-2017 Embarcadero Technologies, Inc.
testgif7.c:
Error E2141 c:\bcc73\include\dinkumware\exception 15: Declaration syntax error
Error E2293 c:\bcc73\include\dinkumware\exception 16: ) expected
Error E2141 c:\bcc73\include\dinkumware\exception 17: Declaration syntax error
Error E2293 c:\bcc73\include\dinkumware\exception 18: ) expected
Error E2141 c:\bcc73\include\dinkumware\exception 114: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\exception 145: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\exception 181: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\exception 182: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\exception 183: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\new 15: Declaration syntax error
Error E2453 c:\bcc73\include\dinkumware\new 73: Size of the type 'nothrow_t' is unknown or zero
Error E2141 c:\bcc73\include\dinkumware\new 75: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\new 79: Declaration syntax error
Error E2449 c:\bcc73\include\dinkumware\new 93: Size of 'operator' is unknown or zero
Error E2141 c:\bcc73\include\dinkumware\new 93: Declaration syntax error
Error E2356 c:\bcc73\include\dinkumware\new 95: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 93: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 95: Declaration syntax error
Error E2356 c:\bcc73\include\dinkumware\new 99: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 95: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 99: Declaration syntax error
Error E2092 c:\bcc73\include\dinkumware\new 102: Storage class 'inline' is not allowed here
Error E2356 c:\bcc73\include\dinkumware\new 102: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 99: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 102: Declaration syntax error
Error E2356 c:\bcc73\include\dinkumware\new 116: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 99: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 116: Declaration syntax error
Error E2356 c:\bcc73\include\dinkumware\new 120: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 116: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 120: Declaration syntax error
Error E2092 c:\bcc73\include\dinkumware\new 123: Storage class 'inline' is not allowed here
Error E2356 c:\bcc73\include\dinkumware\new 123: Type mismatch in redeclaration of 'operator'
Error E2344 c:\bcc73\include\dinkumware\new 120: Earlier declaration of 'operator'
Error E2141 c:\bcc73\include\dinkumware\new 123: Declaration syntax error
Error E2449 c:\bcc73\include\dinkumware\new 131: Size of 'operator' is unknown or zero
Error E2141 c:\bcc73\include\dinkumware\new 131: Declaration syntax error
Error E2449 c:\bcc73\include\dinkumware\new 134: Size of 'operator' is unknown or zero
Error E2141 c:\bcc73\include\dinkumware\new 134: Declaration syntax error
Error E2449 c:\bcc73\include\dinkumware\new 137: Size of 'operator' is unknown or zero
Error E2141 c:\bcc73\include\dinkumware\new 137: Declaration syntax error
Error E2356 c:\bcc73\include\dinkumware\cstring 29: Type mismatch in redeclaration of 'memchr'
Error E2344 c:\bcc73\include\windows\crtl\mem.h 81: Earlier declaration of 'memchr'
Error E2141 c:\bcc73\include\dinkumware\cwchar 36: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\cwchar 41: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\iosfwd 19: Declaration syntax error
Error E2141 c:\bcc73\include\dinkumware\iosfwd 107: Declaration syntax error
Error E2040 c:\bcc73\include\dinkumware\iosfwd 126: Declaration terminated incorrectly
Error E2257 c:\bcc73\include\dinkumware\iosfwd 129: , expected
Error E2141 c:\bcc73\include\dinkumware\iosfwd 132: Declaration syntax error
Error E2228 c:\bcc73\include\dinkumware\iosfwd 132: Too many error or warning messages
*** 51 errors in Compile ***
* Linking errors *
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for xHarbour 17.01 - Jan. 2017 xHarbour development power ³Ü
ECHO ³ (c) FiveTech 1993-2017 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
ECHO Compiling...
if "%FWDIR%" == "" set FWDIR=.\..\
if "%XHDIR%" == "" set XHDIR=c:\XHBBCC72
rem if "%2" == "/b" set GT=gtwin
rem if not "%2" == "/b" set GT=gtgui
set GT=gtgui
set hdir=%XHDIR%
set hdirl=%hdir%\lib
set bcdir=c:\bcc73
set fwh=%FWDIR%
%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
REM %hdir%\bin\harbour %1 /m /n /w1 /es2 /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log
@type warnings.log
echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE
IF EXIST %1.rc %bcdir%\bin\brc32.exe -r -I%bcdir%\include -I%bcdir%\include\windows\sdk %1
REM IF EXIST %1.rc %bcdir%\bin\brc32.exe -p -I%bcdir%\include -I%bcdir%\include\windows\sdk %1
echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib %fwh%\lib\libmysql.lib + >> b32.bc
rem echo %fwh%\lib\Dolphin.lib + >> b32.bc
echo %fwh%\lib\libmariadb.lib + >> b32.bc
echo %fwh%\lib\libmysqld.lib + >> b32.bc
echo %fwh%\lib\libcurl.lib + >> b32.bc
echo %hdirl%\rtl.lib + >> b32.bc
echo %hdirl%\vm.lib + >> b32.bc
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\lang.lib + >> b32.bc
echo %hdirl%\macro.lib + >> b32.bc
echo %hdirl%\rdd.lib + >> b32.bc
echo %hdirl%\dbfntx.lib + >> b32.bc
echo %hdirl%\dbfcdx.lib + >> b32.bc
echo %hdirl%\dbffpt.lib + >> b32.bc
echo %hdirl%\hbsix.lib + >> b32.bc
echo %hdirl%\debug.lib + >> b32.bc
echo %hdirl%\common.lib + >> b32.bc
echo %hdirl%\codepage.lib + >> b32.bc
echo %hdirl%\pp.lib + >> b32.bc
echo %hdirl%\pcrepos.lib + >> b32.bc
echo %hdirl%\ct.lib + >> b32.bc
echo %hdirl%\pdflib.lib + >> b32.bc
echo %hdirl%\hbzebra.lib + >> b32.bc
echo %hdirl%\zlib.lib + >> b32.bc
echo %hdirl%\hbzip.lib + >> b32.bc
echo %hdirl%\libmisc.lib + >> b32.bc
echo %hdirl%\tip.lib + >> b32.bc
echo %hdirl%\png.lib + >> b32.bc
rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc
echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\wininet.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc
IF EXIST %1.res echo %1.res >> b32.bc
rem uncomment this line to use the debugger and comment the following one
if %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
if %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO
rem delete temporary files
@del %1.c
:COMPILEERRORS
@type comp.log
ECHO * Compile errors *
GOTO EXIT
:LINKERROR
ECHO * Linking errors *
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
:NOEXIST
ECHO The specified PRG %1 does not exist
:EXIT
%bcdir%\bin\bcc32 -M -c -v -P @b32.bc
Enrico Maria Giordano wrote:There is no -P switch in that batch file. Please add -P switch here:
- Code: Select all Expand view RUN
%bcdir%\bin\bcc32 -M -c -v -P @b32.bc
EMG
#pragma BEGINDUMP
#include <hbapi.h>
void hb_storvni( int iValue, int iParam, int iIndex )
{
hb_storni( iValue, iParam, iIndex );
}
#pragma ENDDUMP
Enrico Maria Giordano wrote:hb_storni() is inside harbour.prg that should be included in fiveh.lib. Anyway, this is a stand alone version that you can add to your PRG:
- Code: Select all Expand view RUN
#pragma BEGINDUMP
#include <hbapi.h>
void hb_storvni( int iValue, int iParam, int iIndex )
{
hb_storni( iValue, iParam, iIndex );
}
#pragma ENDDUMP
EMG
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 58 guests