diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 59b27a931d..4b23960450 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,19 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-27 19:57 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbmisc/Makefile + + contrib/hbmisc/calldll.prg + + Added CALLDLL compatibility API interface: + CALLDLL32(), HB_DYNACALL1(), STRPTR(), PTRSTR(), UNLOADALLDLL(). + ; Lightly tested, it's based on core .dll functions, so it may only + need easy tweaking. Notice that this API support all platforms, + not just 32-bit Windows. + The original library is found in MINIGUI f.e. + + * contrib/hbwin/win_shell.c + * Minor formatting. + 2010-05-27 19:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/wapi_wingdi.c * contrib/hbwin/hbolesrv.c diff --git a/harbour/contrib/hbmisc/Makefile b/harbour/contrib/hbmisc/Makefile index 090c49bd04..be62f6ded9 100644 --- a/harbour/contrib/hbmisc/Makefile +++ b/harbour/contrib/hbmisc/Makefile @@ -16,6 +16,7 @@ C_SOURCES := \ stringsx.c \ PRG_SOURCES := \ + calldll.prg \ fcomma.prg \ fileread.prg \ hbedit.prg \ diff --git a/harbour/contrib/hbmisc/calldll.prg b/harbour/contrib/hbmisc/calldll.prg new file mode 100644 index 0000000000..ca539c7def --- /dev/null +++ b/harbour/contrib/hbmisc/calldll.prg @@ -0,0 +1,86 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * CALLDLL compatibility library. EXPERIMENTAL CODE. USE AT YOUR OWN RISK. NO GUARANTEES. + * + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#include "common.ch" + +#include "hbdyn.ch" + +STATIC s_hDLL := { => } + +PROCEDURE UNLOADALLDLL() + s_hDLL := { => } + RETURN + +FUNCTION CALLDLL32( cFunction, cLibrary, ... ) + RETURN HB_DYNACALL1( cFunction, cLibrary, NIL, ... ) + +FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... ) + + HB_SYMBOL_UNUSED( nCount ) + + IF ISCHARACTER( cFunction ) .AND. ; + ISCHARACTER( cLibrary ) + + IF !( cLibrary $ s_hDLL ) + s_hDLL[ cLibrary ] := hb_LibLoad( cLibrary ) + ENDIF + + RETURN hb_dynCall( { cFunction, s_hDLL[ cLibrary ], HB_DYN_CTYPE_CHAR_PTR }, ... ) + ENDIF + + RETURN NIL + +FUNCTION STRPTR( x ) + RETURN x + +FUNCTION PTRSTR( x ) + RETURN x diff --git a/harbour/contrib/hbwin/win_shell.c b/harbour/contrib/hbwin/win_shell.c index e9208e13a2..803e59e20b 100644 --- a/harbour/contrib/hbwin/win_shell.c +++ b/harbour/contrib/hbwin/win_shell.c @@ -118,7 +118,7 @@ typedef struct _SHNAMEMAPPING LPTSTR pszNewPath; int cchOldPath; int cchNewPath; -} SHNAMEMAPPING, *LPSHNAMEMAPPING; +} SHNAMEMAPPING, * LPSHNAMEMAPPING; #endif