2008-09-10 13:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* doc/whatsnew.txt
    + Updated.

  * contrib/hbw32/Makefile
  * contrib/hbw32/common.mak
  - contrib/hbw32/w32_prn.c
  + contrib/hbw32/win_prn1.c
  - contrib/hbw32/tprinter.c
  + contrib/hbw32/win_prn2.c
  - contrib/hbw32/dllcall.c
  + contrib/hbw32/win_dll.c
  - contrib/hbw32/w32_osc.c
  + contrib/hbw32/win_osc.c
  - contrib/hbw32/w32_ole.c
  + contrib/hbw32/win_ole.c
  - contrib/hbw32/w32_regc.c
  + contrib/hbw32/win_regc.c
  - contrib/hbw32/w32_os.prg
  + contrib/hbw32/win_os.prg
  - contrib/hbw32/w32_tole.prg
  + contrib/hbw32/win_tole.prg
  - contrib/hbw32/w32_reg.prg
  + contrib/hbw32/win_reg.prg
  - contrib/hbw32/w32_tprn.prg
  + contrib/hbw32/win_tprn.prg
    * Cleaned some 'w32'.

  * contrib/hbwhat/hbwhat.h
    ! Hack to disable UNICODE if enabled.
      hbwhat cannot currently be compiled in UNICODE mode.

  * contrib/hbwhat/wincorec.c
  * contrib/hbwhat/whtmisc.c
    % Made some internal functions static by moving them around.
    ! Removed TEXT( <function_call> ) type of syntax.

  * contrib/hbodbc/odbc.c
    ! MSVC warning fixed in the UNICODE path.

  * contrib/hbnf/getenvrn.c
    ! Fixed to compile in Windows/UNICODE mode.
This commit is contained in:
Viktor Szakats
2008-09-10 11:30:01 +00:00
parent 1a0fe3ae19
commit 5297b54e6e
19 changed files with 149 additions and 96 deletions

View File

@@ -8,6 +8,49 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-09-10 13:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* doc/whatsnew.txt
+ Updated.
* contrib/hbw32/Makefile
* contrib/hbw32/common.mak
- contrib/hbw32/w32_prn.c
+ contrib/hbw32/win_prn1.c
- contrib/hbw32/tprinter.c
+ contrib/hbw32/win_prn2.c
- contrib/hbw32/dllcall.c
+ contrib/hbw32/win_dll.c
- contrib/hbw32/w32_osc.c
+ contrib/hbw32/win_osc.c
- contrib/hbw32/w32_ole.c
+ contrib/hbw32/win_ole.c
- contrib/hbw32/w32_regc.c
+ contrib/hbw32/win_regc.c
- contrib/hbw32/w32_os.prg
+ contrib/hbw32/win_os.prg
- contrib/hbw32/w32_tole.prg
+ contrib/hbw32/win_tole.prg
- contrib/hbw32/w32_reg.prg
+ contrib/hbw32/win_reg.prg
- contrib/hbw32/w32_tprn.prg
+ contrib/hbw32/win_tprn.prg
* Cleaned some 'w32'.
* contrib/hbwhat/hbwhat.h
! Hack to disable UNICODE if enabled.
hbwhat cannot currently be compiled in UNICODE mode.
* contrib/hbwhat/wincorec.c
* contrib/hbwhat/whtmisc.c
% Made some internal functions static by moving them around.
! Removed TEXT( <function_call> ) type of syntax.
* contrib/hbodbc/odbc.c
! MSVC warning fixed in the UNICODE path.
* contrib/hbnf/getenvrn.c
! Fixed to compile in Windows/UNICODE mode.
2008-09-10 09:46 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* doc/whatsnew.txt
+ Updated.

View File

@@ -185,15 +185,15 @@ HB_FUNC( FT_GETE )
}
#elif defined(HB_OS_WIN_32)
{
char *buffer = NULL;
LPVOID lpEnviron = GetEnvironmentStringsA();
LPVOID lpEnviron = GetEnvironmentStrings();
char *sCurEnv;
int x;
int buffsize = 0;
int rettype = NORETURN;
char * szEnviron = HB_TCHAR_CONVFROM( lpEnviron );
if( ISCHAR( 1 ) )
rettype = CHARTYPE;
if( ISARRAY( 1 ) )
@@ -202,7 +202,7 @@ HB_FUNC( FT_GETE )
if( rettype == CHARTYPE )
/* scan strings first and add up total size */
{
for( sCurEnv = ( LPSTR ) lpEnviron; *sCurEnv; sCurEnv++ )
for( sCurEnv = szEnviron; *sCurEnv; sCurEnv++ )
{
if( !*sCurEnv )
/* null string, we're done */
@@ -222,7 +222,7 @@ HB_FUNC( FT_GETE )
buffer[0] = '\0';
}
x = 0;
for( sCurEnv = ( LPSTR ) lpEnviron; *sCurEnv; sCurEnv++ )
for( sCurEnv = szEnviron; *sCurEnv; sCurEnv++ )
{
if( !*sCurEnv )
/* null string, we're done */
@@ -254,6 +254,7 @@ HB_FUNC( FT_GETE )
/* return number of strings found */
hb_retni( x );
HB_TCHAR_FREE( szEnviron );
FreeEnvironmentStrings( ( LPTSTR ) lpEnviron );
}

View File

@@ -187,11 +187,11 @@ HB_FUNC( SQLCONNECT ) /* HB_SQLCONNECT( hDbc, cDSN, cUseName, cPassword ) --> nR
ret = SQLConnect( ( HDBC ) hb_parptr( 1 ),
lpDSN,
hb_parclen( 2 ),
( SQLSMALLINT ) hb_parclen( 2 ),
lpUseName,
hb_parclen( 3 ),
( SQLSMALLINT ) hb_parclen( 3 ),
lpPassword,
hb_parclen( 4 ) );
( SQLSMALLINT ) hb_parclen( 4 ) );
HB_TCHAR_FREE( lpDSN );
HB_TCHAR_FREE( lpUseName );

View File

@@ -9,18 +9,18 @@ LIBNAME=hbw32
ifeq ($(HB_ARCHITECTURE),w32)
C_SOURCES=\
dllcall.c \
tprinter.c \
w32_ole.c \
w32_osc.c \
w32_prn.c \
w32_regc.c \
win_dll.c \
win_ole.c \
win_osc.c \
win_prn1.c \
win_prn2.c \
win_regc.c \
PRG_SOURCES=\
w32_os.prg \
w32_reg.prg \
w32_tole.prg \
w32_tprn.prg \
win_os.prg \
win_reg.prg \
win_tole.prg \
win_tprn.prg \
PRG_HEADERS = \
hbw32.ch \

View File

@@ -10,17 +10,17 @@ PRG_HEADERS = \
hbw32.ch \
LIB_OBJS = \
$(OBJ_DIR)dllcall$(OBJEXT) \
$(OBJ_DIR)tprinter$(OBJEXT) \
$(OBJ_DIR)w32_ole$(OBJEXT) \
$(OBJ_DIR)w32_osc$(OBJEXT) \
$(OBJ_DIR)w32_prn$(OBJEXT) \
$(OBJ_DIR)w32_regc$(OBJEXT) \
$(OBJ_DIR)win_dll$(OBJEXT) \
$(OBJ_DIR)win_ole$(OBJEXT) \
$(OBJ_DIR)win_osc$(OBJEXT) \
$(OBJ_DIR)win_prn1$(OBJEXT) \
$(OBJ_DIR)win_prn2$(OBJEXT) \
$(OBJ_DIR)win_regc$(OBJEXT) \
\
$(OBJ_DIR)w32_os$(OBJEXT) \
$(OBJ_DIR)w32_reg$(OBJEXT) \
$(OBJ_DIR)w32_tole$(OBJEXT) \
$(OBJ_DIR)w32_tprn$(OBJEXT) \
$(OBJ_DIR)win_os$(OBJEXT) \
$(OBJ_DIR)win_reg$(OBJEXT) \
$(OBJ_DIR)win_tole$(OBJEXT) \
$(OBJ_DIR)win_tprn$(OBJEXT) \
all: \
$(LIB_PATH) \

View File

@@ -2,6 +2,13 @@
* $Id$
*/
/* TOFIX: Hack to make it compile when UNICODE is set.
This library doesn't support UNICODE yet (?), so we
disable it to avoid build problems. [vszakats] */
#ifdef UNICODE
#undef UNICODE
#endif
//#define HB_PARWH( x ) hb_parnl( x )
//#define HB_RETWH( x ) hb_retnl( ( LONG ) x )
//#define HB_STORWH( x, y ) hb_stornl( ( LONG ) x, y )

View File

@@ -447,54 +447,6 @@ HB_FUNC( WINEXEC )
hb_retni( WinExec( (LPCSTR) hb_parcx( 1 ), (UINT) hb_parni( 2 ) ) );
}
//-----------------------------------------------------------------------------
// Helper routine. Take an input pointer, return closest
// pointer that is aligned on a DWORD (4 byte) boundary.
LPWORD lpwAlign( LPWORD lpIn )
{
HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn;
ul += 3;
ul >>=2;
ul <<=2;
return ( LPWORD ) ul;
}
//-----------------------------------------------------------------------------
int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
{
int nChar = 0;
do {
*lpWCStr++ = (WORD) *lpAnsiIn;
nChar++;
} while (*lpAnsiIn++);
return nChar;
}
/*
alternative to the above function:
//----------------------------------------------------------------------------
// Helper routine. Takes second parameter as Ansi string, copies
// it to first parameter as wide character (16-bits / char) string,
// and returns integer number of wide characters (words) in string
// (including the trailing wide char NULL).
int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
{
int cchAnsi = lstrlen( lpAnsiIn );
return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, lpAnsiIn, cchAnsi, lpWCStr, cchAnsi) +1;
}
*/
// Mutex functions

View File

@@ -40,8 +40,54 @@ LRESULT CALLBACK __WndProc10 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
BOOL CALLBACK __DlgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn);
LPWORD lpwAlign ( LPWORD lpIn);
//-----------------------------------------------------------------------------
// Helper routine. Take an input pointer, return closest
// pointer that is aligned on a DWORD (4 byte) boundary.
static LPWORD lpwAlign( LPWORD lpIn )
{
HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn;
ul += 3;
ul >>=2;
ul <<=2;
return ( LPWORD ) ul;
}
//-----------------------------------------------------------------------------
static int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
{
int nChar = 0;
do {
*lpWCStr++ = (WORD) *lpAnsiIn;
nChar++;
} while (*lpAnsiIn++);
return nChar;
}
/*
alternative to the above function:
//----------------------------------------------------------------------------
// Helper routine. Takes second parameter as Ansi string, copies
// it to first parameter as wide character (16-bits / char) string,
// and returns integer number of wide characters (words) in string
// (including the trailing wide char NULL).
static int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn)
{
int cchAnsi = lstrlen( lpAnsiIn );
return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, lpAnsiIn, cchAnsi, lpWCStr, cchAnsi) +1;
}
*/
//-----------------------------------------------------------------------------
@@ -613,10 +659,11 @@ HB_FUNC( _MAKEDLGTEMPLATE )
*p++ = (short) 0; // Menu (ignored for now.)
*p++ = (short) 0x00; // Class also ignored
if ( hb_parinfa(1,11) == HB_IT_STRING ) {
nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,11) ) );
p += nchar ;
}
if ( hb_parinfa(1,11) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar( p, ( LPSTR ) hb_parc(1,11) );
p += nchar;
}
else
*p++ =0 ;
@@ -627,7 +674,7 @@ HB_FUNC( _MAKEDLGTEMPLATE )
*p++ = (short) hb_parni(1,13);
*p++ = (short) hb_parni(1,14);
nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,15) ) );
nchar = nCopyAnsiToWideChar( p, ( LPSTR ) hb_parc(1,15) );
p += nchar ;
} ;
@@ -658,25 +705,27 @@ HB_FUNC( _MAKEDLGTEMPLATE )
*p++ = LOWORD ( hb_parnl(9,i) ); // id
*p++ = HIWORD ( hb_parnl(9,i) ); // id // 0;
if ( hb_parinfa(10,i) == HB_IT_STRING ) {
nchar = nCopyAnsiToWideChar(p, TEXT ( hb_parc(10,i)) ); // class
p += nchar ;
}
if( hb_parinfa(10,i) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar(p, ( LPSTR ) hb_parc(10,i) ); // class
p += nchar;
}
else
{
*p++ = 0xFFFF ;
{
*p++ = 0xFFFF;
*p++ = (WORD) hb_parni(10,i);
}
}
if ( hb_parinfa(11,i) == HB_IT_STRING ) {
nchar = nCopyAnsiToWideChar(p, (LPSTR) hb_parc(11,i) ); // text
p += nchar ;
}
if ( hb_parinfa(11,i) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar(p, ( LPSTR ) hb_parc(11,i) ); // text
p += nchar;
}
else
{
{
*p++ = 0xFFFF ;
*p++ = (WORD) hb_parni(11,i);
}
}
*p++ = 0x00 ; // extras ( in array 12 )

View File

@@ -208,6 +208,7 @@ Contrib
and fixed to support Win64 platform. INTERNETREADFILE(),
INTERNETWRITEFILE() functions were fixed. what32.ch renamed
to hbwhat.ch.
- hbhpdf fixed HPDF_ADDPAGELABEL().
Known build issues
=============================