2009-12-12 14:36 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbwinuni.h
    ! fixed typo in last commit

  * harbour/contrib/hbwin/win_com.c
    * eliminated HB_TCHAR_*() usage
This commit is contained in:
Przemyslaw Czerpak
2009-12-12 13:36:46 +00:00
parent 8d0fba2d44
commit 9a6ed0a3e7
3 changed files with 26 additions and 8 deletions

View File

@@ -17,6 +17,13 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-12-12 14:36 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbwinuni.h
! fixed typo in last commit
* harbour/contrib/hbwin/win_com.c
* eliminated HB_TCHAR_*() usage
2009-12-12 10:45 UTC-0300 Antonio Carlos Pantaglione <toninho@fwi.com.br>
+ harbour/contrib/hbwin/mapi.c
+ harbour/contrib/hbwin/tests/testmapi.prg

View File

@@ -81,21 +81,32 @@ HB_FUNC( WIN_COMOPEN )
int iParity = hb_parni( 3 );
int iByteSize = hb_parni( 4 );
int iStopBits = hb_parni( 5 );
char szName[ 11 ];
TCHAR tszName[ 11 ];
int iPos, i;
HANDLE hCommPort;
DCB NewDCB;
hb_snprintf( szName, sizeof( szName ), "\\\\.\\COM%d", iPort + 1 );
HB_TCHAR_CPTO( tszName, szName, sizeof( tszName ) - 1 );
TCHAR szName[ 11 ] = { '\\', '\\', '.', '\\', 'C', 'O', 'M', 0, 0, 0, 0 };
i = iPort + 1;
iPos = 6;
while( i > 0 )
{
iPos++;
i /= 10;
}
i = iPort + 1;
while( i > 0 )
{
szName[ iPos-- ] = ( TCHAR ) ( i % 10 + '0' );
i /= 10;
}
s_PortData[ iPort ].hPort = INVALID_HANDLE_VALUE;
s_PortData[ iPort ].iFunction = WIN_COM_FUN_CREATEFILE;
s_PortData[ iPort ].dwError = 0;
if( ( hCommPort = CreateFile( tszName,
if( ( hCommPort = CreateFile( szName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,

View File

@@ -82,8 +82,8 @@
#define HB_ARRAYSETSTR( arr, n, str ) hb_arraySetStr( arr, n, hb_setGetOSCP(), str )
#define HB_ARRAYSETSTRLEN( arr, n, str, len ) hb_arraySetStrLen( arr, n, hb_setGetOSCP(), str, len )
#define HB_ITEMGETSTR( itm, phstr, plen ) hb_itemGetStr( itm, hb_setGetOSCP(), phstr, plen )
#define HB_ITEMPUTSTR( p, str ) hb_itemPutStr( itm, hb_setGetOSCP(), str )
#define HB_ITEMPUTSTRLEN( p, str, len ) hb_itemPutStrLen( itm, hb_setGetOSCP(), str, len )
#define HB_ITEMPUTSTR( itm, str ) hb_itemPutStr( itm, hb_setGetOSCP(), str )
#define HB_ITEMPUTSTRLEN( itm, str, len ) hb_itemPutStrLen( itm, hb_setGetOSCP(), str, len )
#define HB_STRUNSHARE( h, str, len ) hb_strunshare( h, str, len )
#endif