From 1da8d6b404c755924184f6405bc6a4dd1df92de7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 15 Feb 2010 11:14:14 +0000 Subject: [PATCH] 2010-02-15 12:09 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * Changed to use win-make/dos-make in examples. * contrib/hbwin/win_tbmp.prg - Deleted XBPBITMAP class mapped to WIN_BMP. This should be the job of HBXBP. * contrib/xpp/xpp.hbc + contrib/xpp/tests + contrib/xpp/tests/testdll.prg * contrib/xpp/Makefile + contrib/xpp/win_dllx.c * contrib/hbwin/Makefile - contrib/hbwin/win_dllx.c * contrib/hbwin/tests/testdll.prg + Moved Xbase++ compatible DLL functions to xpp lib. * INCOMPATIBLE change. If you use these functions (DLL*()) add xpp lib to your lib list. ; Finally we don't have any HB_COMPAT_* dependent parts in hbwin. * contrib/hbwin/hbwin.ch * Changed to use full (0xFF) color components for RGB presets. * contrib/gtwvg/Makefile * Deleted trailing spaces. --- harbour/ChangeLog | 50 ++++++++++--- harbour/INSTALL | 62 +++++++-------- harbour/contrib/gtwvg/Makefile | 4 +- harbour/contrib/hbwin/Makefile | 1 - harbour/contrib/hbwin/hbwin.ch | 14 ++-- harbour/contrib/hbwin/tests/testdll.prg | 33 +------- harbour/contrib/hbwin/win_tbmp.prg | 9 --- harbour/contrib/xpp/Makefile | 7 ++ harbour/contrib/xpp/tests/testdll.prg | 91 +++++++++++++++++++++++ harbour/contrib/{hbwin => xpp}/win_dllx.c | 20 +++-- harbour/contrib/xpp/xpp.hbc | 1 + 11 files changed, 195 insertions(+), 97 deletions(-) create mode 100644 harbour/contrib/xpp/tests/testdll.prg rename harbour/contrib/{hbwin => xpp}/win_dllx.c (96%) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f2e901fc78..4742c3af95 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,34 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-15 12:09 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + * Changed to use win-make/dos-make in examples. + + * contrib/hbwin/win_tbmp.prg + - Deleted XBPBITMAP class mapped to WIN_BMP. + This should be the job of HBXBP. + + * contrib/xpp/xpp.hbc + + contrib/xpp/tests + + contrib/xpp/tests/testdll.prg + * contrib/xpp/Makefile + + contrib/xpp/win_dllx.c + * contrib/hbwin/Makefile + - contrib/hbwin/win_dllx.c + * contrib/hbwin/tests/testdll.prg + + Moved Xbase++ compatible DLL functions to xpp lib. + * INCOMPATIBLE change. If you use these functions (DLL*()) + add xpp lib to your lib list. + ; Finally we don't have any HB_COMPAT_* dependent parts + in hbwin. + + * contrib/hbwin/hbwin.ch + * Changed to use full (0xFF) color components for RGB presets. + + * contrib/gtwvg/Makefile + * Deleted trailing spaces. + 2010-02-15 10:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbvm.h * harbour/src/vm/hvm.c @@ -62,9 +90,9 @@ * contrib/hbqt/qtgui/THBQPlainTextEdit.prg + Added class variable :block which can be set with qEdit:hbSetEventBlock( bBlock ). I did not set it via the constructor as it is implementation specific. - The goal was to capture mouse or other events which are consumed by - parent class itself and are not forwarded to the widget. At present - it is used to inform double-click event to qEdit and is scheduled + The goal was to capture mouse or other events which are consumed by + parent class itself and are not forwarded to the widget. At present + it is used to inform double-click event to qEdit and is scheduled to be extended. * contrib/hbqt/hbqt_misc.prg @@ -80,13 +108,13 @@ * contrib/hbide/idemisc.prg * contrib/hbide/ideprojmanager.prg - + Project Management: enabled "Launch Parameters" which are supplied to the - executable if "Launch..." is selected with build + + Project Management: enabled "Launch Parameters" which are supplied to the + executable if "Launch..." is selected with build or otherwise. : supressed auto expansion of "Current Project" at startup. - Was a constant cause of annoyance if the project tree + Was a constant cause of annoyance if the project tree been fairly large. - + Docking Windows: reworked to occupy proper corners. + + Docking Windows: reworked to occupy proper corners. Please delete idesettings.ini. ! Find_Replace Dialog: set to find from begining if "Find What" is changed. @@ -94,12 +122,12 @@ ! Code Skeletons: fixed to not append blank lines while called. : selection menu appears at the current cursor coordinates. - + Editor: double-click on some word place the selection in copy buffer in case + + Editor: double-click on some word place the selection in copy buffer in case that word is selected. This feature I always wished-for in xMate. - + Editor: highly .prg code suited indentation engine. It comprise so many + + Editor: highly .prg code suited indentation engine. It comprise so many factors to explain. Please test. I feel you will be really happy. - Also let me know what else can be implemented. Code is now + Also let me know what else can be implemented. Code is now under my grasp and probably more ideas are already building up. 2010-02-14 21:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) @@ -284,7 +312,7 @@ + Reworked WIN_DLLCALL() and low-level hbwin_dllCall() interfaces. * WIN_DLLCALL() should be called as follows: - WIN_DLLCALL( , ... ) -> + WIN_DLLCALL( | , ... ) -> where can be: { | , | [, [, , ..., ]] } diff --git a/harbour/INSTALL b/harbour/INSTALL index 255f9a8633..084f1b9add 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -739,62 +739,62 @@ HARBOUR --- Windows SDK 7 call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" - mingw32-make + win-make --- --- Windows SDK 7 for Windows x86-64 (requires preceding build for native target) call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat" - mingw32-make + win-make --- --- MSVC 2008 + SDK set WindowsSDKDir=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\ call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" - mingw32-make + win-make --- --- MSVC 2008 call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" - mingw32-make + win-make --- --- MSVC 2008 (Standard or above) for Windows x86-64 (requires preceding build for native target) call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 - mingw32-make + win-make --- --- MSVC 2008 (Team Suite) for Windows IA-64 Itanium (requires preceding build for native target) call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 - mingw32-make + win-make --- --- MSVC 2008 for Windows CE ARM (requires preceding build for native target) set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i set LIB=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I set PATH=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE;%PATH% - mingw32-make + win-make --- --- MSVC 2005 call "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat" - mingw32-make + win-make --- --- MSVC 2005 for Windows CE ARM (requires preceding build for native target) set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i set LIB=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I set PATH=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE;%PATH% - mingw32-make + win-make --- --- MSVC .NET 2003 (untested) call "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\vcvarsall.bat" - mingw32-make + win-make --- --- MinGW GCC set PATH=C:\mingw\bin;%PATH% - mingw32-make + win-make --- --- MinGW GCC using MSYS shell @@ -804,14 +804,14 @@ HARBOUR --- MinGW GCC for Windows x86-64 (requires preceding build for native target) set PATH=C:\mingw64\bin;%PATH% - mingw32-make + win-make --- --- MinGW GCC for Windows CE ARM (requires Cygwin + preceding build for native target) set PATH=C:\mingwce\opt\mingw32ce\bin;C:\cygwin\bin;%PATH% rem ; optional set CYGWIN=nodosfilewarning - mingw32-make + win-make --- --- Cygwin GCC using Cygwin shell @@ -821,44 +821,44 @@ HARBOUR --- Intel(R) C++ call "%ProgramFiles%\Intel\Compiler\C++\10.1.014\IA32\Bin\iclvars.bat" - mingw32-make + win-make --- --- Intel(R) C++ for Windows IA-64 Itanium (requires preceding build for native target) call "%ProgramFiles%\Intel\Compiler\C++\10.1.025\Itanium\Bin\iclvars.bat" - mingw32-make + win-make --- --- Borland C++ 5.5.1 set PATH=C:\Borland\BCC55\Bin;%PATH% - mingw32-make + win-make --- --- Pelles C set PATH=%ProgramFiles%\PellesC\Bin;%PATH% set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE% set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win;%LIB% - mingw32-make + win-make --- --- Pelles C for Windows x86-64 (requires preceding build for native target) set PATH=%ProgramFiles%\PellesC\Bin;%PATH% set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE% set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win64;%LIB% - mingw32-make + win-make --- --- Pelles C for Windows CE ARM (requires preceding build for native target) set PATH=%ProgramFiles%\PellesC\Bin;%PATH% set INCLUDE=%ProgramFiles%\PellesC\Include\WinCE;%ProgramFiles%\PellesC\Include;%INCLUDE% set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\WinCE;%LIB% - mingw32-make + win-make --- --- Delorie GNU C for MS-DOS (on Intel 32-bit Windows hosts only) set DJGPP=C:\djgpp\djgpp.env set PATH=C:\djgpp\bin;%PATH% - mingw32-make + win-make --- --- Open Watcom C/C++ @@ -866,7 +866,7 @@ HARBOUR SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH% SET EDPATH=%WATCOM%\EDDAT SET INCLUDE=%WATCOM%\H;%WATCOM%\H\NT - mingw32-make + win-make --- --- Open Watcom C/C++ for MS-DOS @@ -874,7 +874,7 @@ HARBOUR SET PATH=%WATCOM%\BINNT;%PATH% SET EDPATH=%WATCOM%\EDDAT SET INCLUDE=%WATCOM%\H - mingw32-make + win-make --- --- Open Watcom C/C++ for OS/2 (requires preceding build for Windows target) @@ -883,7 +883,7 @@ HARBOUR SET BEGINLIBPATH=%WATCOM%\BINP\DLL SET EDPATH=%WATCOM%\EDDAT SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2 - mingw32-make + win-make --- --- Open Watcom C/C++ for Linux (requires preceding build for Windows target) @@ -891,7 +891,7 @@ HARBOUR SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH% SET EDPATH=%WATCOM%\EDDAT SET INCLUDE=%WATCOM%\LH - mingw32-make + win-make --- --8<-- @@ -922,27 +922,27 @@ HARBOUR --- Windows SDK 7 for Windows x86 call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" - mingw32-make + win-make --- --- Windows SDK 7 for Windows x86-64 call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" - mingw32-make + win-make --- --- MSVC 2008 for Windows x86 call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" - mingw32-make + win-make --- --- MSVC 2008 (Standard or above) for Windows x86-64 call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 - mingw32-make + win-make --- --- MSVC 2008 (Team Suite) for Windows IA-64 Itanium (requires preceding build for native target) call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 - mingw32-make + win-make --- for MS-DOS hosts @@ -951,7 +951,7 @@ HARBOUR --- Delorie GNU C set DJGPP=C:\djgpp\djgpp.env set PATH=C:\djgpp\bin;%PATH% - make + dos-make --- --- Open Watcom C/C++ @@ -959,7 +959,7 @@ HARBOUR SET PATH=%WATCOM%\BINW;%PATH% SET EDPATH=%WATCOM%\EDDAT SET INCLUDE=%WATCOM%\H - make + dos-make --- --8<-- diff --git a/harbour/contrib/gtwvg/Makefile b/harbour/contrib/gtwvg/Makefile index 7d4af65261..39129eeefd 100644 --- a/harbour/contrib/gtwvg/Makefile +++ b/harbour/contrib/gtwvg/Makefile @@ -53,9 +53,9 @@ PRG_HEADERS := \ wvgparts.ch \ ifeq ($(HB_PLATFORM),win) - + HB_INC_DEPEND := -I$(TOP)$(ROOT)contrib/hbwin - + include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk else diff --git a/harbour/contrib/hbwin/Makefile b/harbour/contrib/hbwin/Makefile index 73b4b28bca..41d6e67216 100644 --- a/harbour/contrib/hbwin/Makefile +++ b/harbour/contrib/hbwin/Makefile @@ -36,7 +36,6 @@ C_SOURCES := \ win_com.c \ win_dlg.c \ win_dllc.c \ - win_dllx.c \ win_misc.c \ win_osc.c \ win_prn1.c \ diff --git a/harbour/contrib/hbwin/hbwin.ch b/harbour/contrib/hbwin/hbwin.ch index 93b767f752..eb4bbbb21e 100644 --- a/harbour/contrib/hbwin/hbwin.ch +++ b/harbour/contrib/hbwin/hbwin.ch @@ -149,13 +149,13 @@ /* Color constants for convenience */ #define HB_WIN_RGB_BLACK WIN_RGB( 0x00, 0x00, 0x00 ) -#define HB_WIN_RGB_BLUE WIN_RGB( 0x00, 0x00, 0x85 ) -#define HB_WIN_RGB_GREEN WIN_RGB( 0x00, 0x85, 0x00 ) -#define HB_WIN_RGB_CYAN WIN_RGB( 0x00, 0x85, 0x85 ) -#define HB_WIN_RGB_RED WIN_RGB( 0x85, 0x00, 0x00 ) -#define HB_WIN_RGB_MAGENTA WIN_RGB( 0x85, 0x00, 0x85 ) -#define HB_WIN_RGB_BROWN WIN_RGB( 0x85, 0x85, 0x00 ) -#define HB_WIN_RGB_WHITE WIN_RGB( 0xC6, 0xC6, 0xC6 ) +#define HB_WIN_RGB_BLUE WIN_RGB( 0x00, 0x00, 0xFF ) +#define HB_WIN_RGB_GREEN WIN_RGB( 0x00, 0xFF, 0x00 ) +#define HB_WIN_RGB_CYAN WIN_RGB( 0x00, 0xFF, 0xFF ) +#define HB_WIN_RGB_RED WIN_RGB( 0xFF, 0x00, 0x00 ) +#define HB_WIN_RGB_MAGENTA WIN_RGB( 0xFF, 0x00, 0xFF ) +#define HB_WIN_RGB_BROWN WIN_RGB( 0xFF, 0xFF, 0x00 ) +#define HB_WIN_RGB_WHITE WIN_RGB( 0xFF, 0xFF, 0xFF ) /* WIN_SETDOCUMENTPROPERTIES() paper types */ #define WIN_DMPAPER_LETTER 1 diff --git a/harbour/contrib/hbwin/tests/testdll.prg b/harbour/contrib/hbwin/tests/testdll.prg index 6bf271891e..6fc619dfce 100644 --- a/harbour/contrib/hbwin/tests/testdll.prg +++ b/harbour/contrib/hbwin/tests/testdll.prg @@ -49,29 +49,7 @@ PROCEDURE Main() LOCAL hDLL LOCAL cData - IF hb_FileExists( "pscript.dll" ) - hDLL := DllLoad( "pscript.dll" ) - cData := Space( 24 ) - DllCall( hDll, NIL, "PSGetVersion", @cData ) - ? ">" + cData + "<" - DllUnload( hDLL ) - - // ; Testing failure 1 - hDLL := DllLoad( "pscript.dll" ) - cData := Space( 24 ) - DllCall( hDll, NIL, "PSGet__Version", @cData ) - ? ">" + cData + "<" - DllUnload( hDLL ) - ENDIF - - // ; Testing failure 2 - hDLL := DllLoad( "nothere.dll" ) - cData := Space( 24 ) - DllCall( hDll, NIL, "PSGetVersion", @cData ) - ? cData - DllUnload( hDLL ) - - ? "MsgBox:", DllCall( "user32.dll", NIL, "MessageBoxA", 0, "Hello world!", "Harbour sez", hb_bitOr( MB_OKCANCEL, MB_ICONEXCLAMATION, MB_HELP ) ) + ? "MsgBox:", win_DllCall( { "MessageBoxA", "user32.dll" }, 0, "Hello world!", "Harbour sez", hb_bitOr( MB_OKCANCEL, MB_ICONEXCLAMATION, MB_HELP ) ) IF hb_FileExists( "libcurl.dll" ) hDLL := wapi_LoadLibrary( "libcurl.dll" ) @@ -86,11 +64,11 @@ PROCEDURE Main() #define SPI_SETDRAGFULLWINDOWS 37 ? "Full content drag: OFF" - ? DllCall( "user32.dll", NIL, "SystemParametersInfo", SPI_SETDRAGFULLWINDOWS, 0, 0, 0 ) + ? win_DllCall( { "SystemParametersInfo", "user32.dll" }, SPI_SETDRAGFULLWINDOWS, 0, 0, 0 ) Inkey( 0 ) ? "Full content drag: ON" - ? DllCall( "user32.dll", NIL, "SystemParametersInfo", SPI_SETDRAGFULLWINDOWS, 1, 0, 0 ) + ? win_DllCall( { "SystemParametersInfo", "user32.dll" }, SPI_SETDRAGFULLWINDOWS, 1, 0, 0 ) Inkey( 0 ) /* Get some standard Windows folders */ @@ -124,9 +102,4 @@ PROCEDURE Main() ? "------" wapi_FreeLibrary( hDLL ) - ? "DLLCALL" - cData := Space( MAX_PATH ) - ? DllCall( "shell32.dll", NIL, "SHGetFolderPath", 0, CSIDL_ADMINTOOLS, 0, 0, @cData ) - ? "REF:", cData - RETURN diff --git a/harbour/contrib/hbwin/win_tbmp.prg b/harbour/contrib/hbwin/win_tbmp.prg index 5d857cfb5c..62b3dedfbc 100644 --- a/harbour/contrib/hbwin/win_tbmp.prg +++ b/harbour/contrib/hbwin/win_tbmp.prg @@ -111,12 +111,3 @@ METHOD Draw( oPrn, aRectangle, /* @ */ nError ) CLASS WIN_BMP // Pass a WIN_PRN ::Rect := aRectangle ENDIF RETURN iif( ::IsSupported( oPrn, @nError ), oPrn:DrawBitMap( Self ), .F. ) - -#ifdef HB_COMPAT_XPP - -/* Compatibility Class for Alaska Xbase++ */ - -CREATE CLASS XBPBITMAP FROM WIN_BMP -ENDCLASS - -#endif diff --git a/harbour/contrib/xpp/Makefile b/harbour/contrib/xpp/Makefile index 959e97d0b9..514ec3afad 100644 --- a/harbour/contrib/xpp/Makefile +++ b/harbour/contrib/xpp/Makefile @@ -4,6 +4,8 @@ ROOT := ../../ +include $(TOP)$(ROOT)config/global.mk + LIBNAME := xpp C_SOURCES := \ @@ -14,6 +16,7 @@ C_SOURCES := \ mousex.c \ oemansix.c \ philesx.c \ + win_dllx.c \ PRG_SOURCES := \ browdbx.prg \ @@ -34,5 +37,9 @@ PRG_SOURCES := \ PRG_HEADERS := \ xpp.ch \ +ifneq ($(filter $(HB_PLATFORM),win wce),) + HB_INC_DEPEND := -I$(TOP)$(ROOT)contrib/hbwin +endif + include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/xpp/tests/testdll.prg b/harbour/contrib/xpp/tests/testdll.prg new file mode 100644 index 0000000000..17ece21b84 --- /dev/null +++ b/harbour/contrib/xpp/tests/testdll.prg @@ -0,0 +1,91 @@ +/* + * $Id$ + */ + +#include "simpleio.ch" + +/* + * Harbour Project source code: + * DLL call demonstration. + * + * Copyright 2008 Viktor Szakats (harbour.01 syenar.hu) + * www - http://www.harbour-project.org + * + */ + +#define MB_OK 0x00000000 +#define MB_OKCANCEL 0x00000001 +#define MB_ABORTRETRYIGNORE 0x00000002 +#define MB_YESNOCANCEL 0x00000003 +#define MB_YESNO 0x00000004 +#define MB_RETRYCANCEL 0x00000005 +#define MB_CANCELTRYCONTINUE 0x00000006 +#define MB_ICONHAND 0x00000010 +#define MB_ICONQUESTION 0x00000020 +#define MB_ICONEXCLAMATION 0x00000030 +#define MB_ICONASTERISK 0x00000040 +#define MB_USERICON 0x00000080 +#define MB_DEFBUTTON2 0x00000100 +#define MB_DEFBUTTON3 0x00000200 +#define MB_DEFBUTTON4 0x00000300 +#define MB_SYSTEMMODAL 0x00001000 +#define MB_TASKMODAL 0x00002000 +#define MB_HELP 0x00004000 +#define MB_NOFOCUS 0x00008000 +#define MB_SETFOREGROUND 0x00010000 +#define MB_DEFAULT_DESKTOP_ONLY 0x00020000 +#define MB_TOPMOST 0x00040000 +#define MB_RIGHT 0x00080000 +#define MB_RTLREADING 0x00100000 + +#define CSIDL_APPDATA 0x001a /* \Application Data */ +#define CSIDL_ADMINTOOLS 0x0030 /* \Start Menu\Programs\Administrative Tools */ + +#define MAX_PATH 260 + +PROCEDURE Main() + LOCAL hDLL + LOCAL cData + + IF hb_FileExists( "pscript.dll" ) + hDLL := DllLoad( "pscript.dll" ) + cData := Space( 24 ) + DllCall( hDll, NIL, "PSGetVersion", @cData ) + ? ">" + cData + "<" + DllUnload( hDLL ) + + // ; Testing failure 1 + hDLL := DllLoad( "pscript.dll" ) + cData := Space( 24 ) + DllCall( hDll, NIL, "PSGet__Version", @cData ) + ? ">" + cData + "<" + DllUnload( hDLL ) + ENDIF + + // ; Testing failure 2 + hDLL := DllLoad( "nothere.dll" ) + cData := Space( 24 ) + DllCall( hDll, NIL, "PSGetVersion", @cData ) + ? cData + DllUnload( hDLL ) + + ? "MsgBox:", DllCall( "user32.dll", NIL, "MessageBoxA", 0, "Hello world!", "Harbour sez", hb_bitOr( MB_OKCANCEL, MB_ICONEXCLAMATION, MB_HELP ) ) + + /* Force Windows not to show dragged windows contents */ + + #define SPI_SETDRAGFULLWINDOWS 37 + + ? "Full content drag: OFF" + ? DllCall( "user32.dll", NIL, "SystemParametersInfo", SPI_SETDRAGFULLWINDOWS, 0, 0, 0 ) + Inkey( 0 ) + + ? "Full content drag: ON" + ? DllCall( "user32.dll", NIL, "SystemParametersInfo", SPI_SETDRAGFULLWINDOWS, 1, 0, 0 ) + Inkey( 0 ) + + ? "DLLCALL" + cData := Space( MAX_PATH ) + ? DllCall( "shell32.dll", NIL, "SHGetFolderPath", 0, CSIDL_ADMINTOOLS, 0, 0, @cData ) + ? "REF:", cData + + RETURN diff --git a/harbour/contrib/hbwin/win_dllx.c b/harbour/contrib/xpp/win_dllx.c similarity index 96% rename from harbour/contrib/hbwin/win_dllx.c rename to harbour/contrib/xpp/win_dllx.c index efbf8217f2..194e809540 100644 --- a/harbour/contrib/hbwin/win_dllx.c +++ b/harbour/contrib/xpp/win_dllx.c @@ -52,12 +52,14 @@ * */ -#include "hbwin.h" +#include "hbapi.h" #include "hbapierr.h" #include "hbapiitm.h" -#include "hbdyn.h" -#ifdef HB_COMPAT_XPP +#if defined( HB_OS_WIN ) + +#include "hbwin.h" +#include "hbdyn.h" /* NOTE: I'm not totally familiar with how Xbase++ works. This functionality was derived from the context in which the functions are used. [pt] */ @@ -139,8 +141,6 @@ HB_FUNC( DLLCALL ) } } -/* TODO: Add support for UNICODE (*W()) calls. */ - HB_FUNC( DLLPREPARECALL ) { PHB_DLLEXEC xec = ( PHB_DLLEXEC ) hb_gcAllocate( sizeof( HB_DLLEXEC ), &s_gcDllFuncs ); @@ -196,4 +196,12 @@ HB_FUNC( DLLEXECUTECALL ) } } -#endif /* HB_COMPAT_XPP */ +#else + +HB_FUNC( DLLLOAD ) { hb_retnint( 0 ); } +HB_FUNC( DLLUNLOAD ) { hb_retl( HB_FALSE ); } +HB_FUNC( DLLCALL ) {} +HB_FUNC( DLLPREPARECALL ) {} +HB_FUNC( DLLEXECUTECALL ) {} + +#endif diff --git a/harbour/contrib/xpp/xpp.hbc b/harbour/contrib/xpp/xpp.hbc index cb3dc3d59a..1bfbb09e7f 100644 --- a/harbour/contrib/xpp/xpp.hbc +++ b/harbour/contrib/xpp/xpp.hbc @@ -5,3 +5,4 @@ incpaths=. libs=xpp +{win}libs=hbwin