2009-12-11 10:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* include/hbextern.ch
    + Added HB_THREADONCEINIT().

  * contrib/hbqt/hbqt.ch
  * contrib/hbxbp/xbp.ch
    ! Moved XBP specific macro to HBXBP header.

  * contrib/hbqt/tests/demoqt.prg
    ! Deleted no more needed init calls.

  * contrib/hbqt/hbqt_events.cpp
    + Added TOFIX about GC collected pointer stored in low level 
      structure. (source of GPF).

  * contrib/hbwin/win_misc.c
  * contrib/hbwin/wapi_winbase.c
  * contrib/hbwin/wapi_winuser.c
  * contrib/hbwin/win_regc.c
  * contrib/hbwin/win_prn1.c
  * contrib/hbwin/win_prn3.c
  * contrib/hbwin/wapi_shellapi.c
  * contrib/hbwin/legacyco.c
    - Deleted now unnecessary '( LP[C]TSTR )' casts.
    + Cleaned const usage in WIN_PRINTERSETDEFAULT().
      F.e. OpenPrinter() has apparently wrong winapi declaration, 
      so a cast must have been added.

    ; TOFIX: CreateProcessW() second parameter has to be a read/write 
             buffer. Przemek, do you have an idea how to solve that 
             the cleanest way?
             (for now I kept a cast, assuming that a buffer is 
             created by Harbour conversion API, but that's not 
             something it guarantees in the future.)
This commit is contained in:
Viktor Szakats
2009-12-11 10:01:12 +00:00
parent 39b0d7abef
commit 32bf41944d
14 changed files with 67 additions and 31 deletions

View File

@@ -17,6 +17,41 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-12-11 10:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbextern.ch
+ Added HB_THREADONCEINIT().
* contrib/hbqt/hbqt.ch
* contrib/hbxbp/xbp.ch
! Moved XBP specific macro to HBXBP header.
* contrib/hbqt/tests/demoqt.prg
! Deleted no more needed init calls.
* contrib/hbqt/hbqt_events.cpp
+ Added TOFIX about GC collected pointer stored in low level
structure. (source of GPF).
* contrib/hbwin/win_misc.c
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/wapi_winuser.c
* contrib/hbwin/win_regc.c
* contrib/hbwin/win_prn1.c
* contrib/hbwin/win_prn3.c
* contrib/hbwin/wapi_shellapi.c
* contrib/hbwin/legacyco.c
- Deleted now unnecessary '( LP[C]TSTR )' casts.
+ Cleaned const usage in WIN_PRINTERSETDEFAULT().
F.e. OpenPrinter() has apparently wrong winapi declaration,
so a cast must have been added.
; TOFIX: CreateProcessW() second parameter has to be a read/write
buffer. Przemek, do you have an idea how to solve that
the cleanest way?
(for now I kept a cast, assuming that a buffer is
created by Harbour conversion API, but that's not
something it guarantees in the future.)
2009-12-11 04:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/thread.c
! added missing HB_STACK_TLS_PRELOAD

View File

@@ -73,8 +73,7 @@
#xtranslate HBQT_DEBUG( [<x,...>] ) => iif( .T.,, )
#endif
#define QT_PTROF( oObj ) ( oObj:pPtr )
#define QT_PTROFXBP( oXbp ) ( oXbp:oWidget:pPtr )
#define QT_PTROF( oObj ) ( oObj:pPtr )
#define HBQT_RELEASE_WITH_DELETE 0 // Release the QObject with delete operator
#define HBQT_RELEASE_WITH_DESTRUTOR 1 // Release the QObject with his destructor

View File

@@ -167,6 +167,7 @@ HB_FUNC( QT_CONNECT_EVENT )
hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", type, "P" ); /* Make it a unique identifier */
t_events->listBlock << codeblock;
/* TOFIX: Reference to GC collected pointer is stored. */
t_events->listObj << object;
object->setProperty( prop, ( int ) t_events->listBlock.size() );

View File

@@ -113,9 +113,6 @@ PROCEDURE Main()
//LOCAL oStyle, oSize, n, aObj := array( nLoops )
//LOCAL nLoops := 500
Qt_SetEventFilter()
Qt_SetEventSlots()
DO CASE
CASE HbQt_Set_Release_Method() == HBQT_RELEASE_WITH_DELETE
HBQT_DEBUG( "HbQt_Set_Release_Method DEFAULT : HBQT_RELEASE_WITH_DELETE" )

View File

@@ -117,7 +117,7 @@ HB_FUNC( MESSAGEBOX )
void * hStr2;
HWND hWnd = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRUINT ) hb_parnint( 1 ) :
( HWND ) hb_parptr( 1 );
hb_retni( MessageBox( hWnd, ( LPCTSTR ) HB_PARSTR( 2, &hStr1, NULL ), ( LPCTSTR ) HB_PARSTR( 3, &hStr2, NULL ), hb_parni( 4 ) ) );
hb_retni( MessageBox( hWnd, HB_PARSTR( 2, &hStr1, NULL ), HB_PARSTR( 3, &hStr2, NULL ), hb_parni( 4 ) ) );
hb_strfree( hStr1 );
hb_strfree( hStr2 );
}

View File

@@ -68,10 +68,10 @@ HB_FUNC( WAPI_SHELLEXECUTE )
void * hDirectory;
hb_retnint( ( HB_PTRDIFF ) ShellExecute( ( HWND ) hb_parptr( 1 ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hOperation , NULL ), /* edit, explore, open, print, play?, properties? */
( LPCTSTR ) HB_PARSTR( 3, &hFile , NULL ),
( LPCTSTR ) HB_PARSTR( 4, &hParameters, NULL ),
( LPCTSTR ) HB_PARSTR( 5, &hDirectory , NULL ),
HB_PARSTRDEF( 2, &hOperation , NULL ), /* edit, explore, open, print, play?, properties? */
HB_PARSTR( 3, &hFile , NULL ),
HB_PARSTR( 4, &hParameters, NULL ),
HB_PARSTR( 5, &hDirectory , NULL ),
HB_ISNUM( 6 ) ? hb_parni( 6 ) : SW_SHOWNORMAL /* nShowCmd */ ) );
hb_strfree( hOperation );

View File

@@ -160,7 +160,7 @@ HB_FUNC( WAPI_LOADLIBRARY )
{
void * hName;
hb_retptr( LoadLibrary( ( LPCTSTR ) HB_PARSTRDEF( 1, &hName, NULL ) ) );
hb_retptr( LoadLibrary( HB_PARSTRDEF( 1, &hName, NULL ) ) );
hb_strfree( hName );
}
@@ -184,7 +184,7 @@ HB_FUNC( WAPI_GETMODULEHANDLE )
{
void * hModuleName;
wapi_ret_HANDLE( GetModuleHandle( ( LPCTSTR ) HB_PARSTR( 1, &hModuleName, NULL ) ) );
wapi_ret_HANDLE( GetModuleHandle( HB_PARSTR( 1, &hModuleName, NULL ) ) );
hb_strfree( hModuleName );
}
@@ -199,7 +199,7 @@ HB_FUNC( WAPI_OUTPUTDEBUGSTRING )
{
void * hOutputString;
OutputDebugString( ( LPCTSTR ) HB_PARSTR( 1, &hOutputString, NULL ) );
OutputDebugString( HB_PARSTR( 1, &hOutputString, NULL ) );
hb_strfree( hOutputString );
}
@@ -213,7 +213,7 @@ HB_FUNC( WAPI_FORMATMESSAGE )
DWORD dwRetVal;
hb_retnl( dwRetVal = FormatMessage( ( DWORD ) hb_parnldef( 1, FORMAT_MESSAGE_FROM_SYSTEM ) /* dwFlags */,
HB_ISCHAR( 2 ) ? ( LPCVOID ) HB_PARSTR( 2, &hSource, NULL ) : hb_parptr( 2 ),
HB_ISCHAR( 2 ) ? HB_PARSTR( 2, &hSource, NULL ) : hb_parptr( 2 ),
HB_ISNUM( 3 ) ? ( DWORD ) hb_parnl( 3 ) : GetLastError() /* dwMessageId */,
( DWORD ) hb_parnldef( 4, MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ) ) /* dwLanguageId */,
lpBuffer,

View File

@@ -74,7 +74,7 @@ HB_FUNC( WAPI_MESSAGEBOX )
{
void * hStr1;
void * hStr2;
hb_retni( MessageBox( ( HWND ) hb_parptr( 1 ), ( LPCTSTR ) HB_PARSTR( 2, &hStr1, NULL ), ( LPCTSTR ) HB_PARSTR( 3, &hStr2, NULL ), hb_parni( 4 ) ) );
hb_retni( MessageBox( ( HWND ) hb_parptr( 1 ), HB_PARSTR( 2, &hStr1, NULL ), HB_PARSTR( 3, &hStr2, NULL ), hb_parni( 4 ) ) );
hb_strfree( hStr1 );
hb_strfree( hStr2 );
}
@@ -86,8 +86,8 @@ HB_FUNC( WAPI_CREATEWINDOWEX )
hb_retptr( CreateWindowEx(
( DWORD ) hb_parnl( 1 ) /* dwExStyle */,
( LPCTSTR ) HB_PARSTRDEF( 2, &hClassName, NULL ),
( LPCTSTR ) HB_PARSTRDEF( 3, &hWindowName, NULL ),
HB_PARSTRDEF( 2, &hClassName, NULL ),
HB_PARSTRDEF( 3, &hWindowName, NULL ),
HB_ISNUM( 4 ) ? ( DWORD ) hb_parnl( 4 ) : WS_OVERLAPPEDWINDOW /* dwStyle */,
HB_ISNUM( 5 ) ? ( int ) hb_parni( 5 ) : ( int ) CW_USEDEFAULT /* x */,
HB_ISNUM( 6 ) ? ( int ) hb_parni( 6 ) : ( int ) CW_USEDEFAULT /* y */,
@@ -307,7 +307,7 @@ HB_FUNC( WAPI_LOADBITMAP )
else
{
void * hBmp;
hb_retptr( LoadBitmap( wapi_par_HINSTANCE( 1 ), ( LPCTSTR ) HB_PARSTRDEF( 2, &hBmp, NULL ) ) );
hb_retptr( LoadBitmap( wapi_par_HINSTANCE( 1 ), HB_PARSTRDEF( 2, &hBmp, NULL ) ) );
hb_strfree( hBmp );
}
}

View File

@@ -85,7 +85,8 @@ HB_FUNC( WIN_RUNDETACHED )
#endif
if( CreateProcess(
( LPCTSTR ) HB_PARSTR( 1, &hCommandName, NULL ), /* Command name */
HB_PARSTR( 1, &hCommandName, NULL ), /* Command name */
/* TOFIX */
( LPTSTR ) HB_PARSTR( 2, &hCommandLine, NULL ), /* Command line (Unicode version needs an non-const buffer) */
NULL, /* Process handle not inheritable */
NULL, /* Thread handle not inheritable */
@@ -139,8 +140,8 @@ HB_FUNC( WIN_LOADRESOURCE )
void * hType;
HRSRC hRes = FindResource( ( HMODULE ) hInstance,
( LPCTSTR ) HB_PARSTRDEF( 1, &hName, NULL ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hType, NULL ) );
HB_PARSTRDEF( 1, &hName, NULL ),
HB_PARSTRDEF( 2, &hType, NULL ) );
if( hRes )
{

View File

@@ -159,7 +159,7 @@ HB_FUNC( WIN_CREATEDC )
{
void * hDevice;
HDC hDC = CreateDC( TEXT( "" ), ( LPCTSTR ) HB_PARSTR( 1, &hDevice, NULL ), NULL, NULL );
HDC hDC = CreateDC( TEXT( "" ), HB_PARSTR( 1, &hDevice, NULL ), NULL, NULL );
if( hDC )
{

View File

@@ -66,7 +66,7 @@
#include "hbapi.h"
#include "hbwinuni.h"
static HB_BOOL hb_SetDefaultPrinter( LPTSTR lpPrinterName )
static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName )
{
BOOL bFlag;
OSVERSIONINFO osv;
@@ -83,7 +83,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPTSTR lpPrinterName )
if( osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{
/* Open this printer so you can get information about it. */
bFlag = OpenPrinter( lpPrinterName, &hPrinter, NULL );
bFlag = OpenPrinter( ( LPTSTR ) lpPrinterName, &hPrinter, NULL );
if( ! bFlag || ! hPrinter )
return HB_FALSE;
@@ -141,7 +141,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPTSTR lpPrinterName )
if( osv.dwMajorVersion >= 5 ) /* Windows 2000 or later (use explicit call) */
{
HMODULE hWinSpool;
typedef BOOL ( WINAPI * DEFPRINTER )( LPTSTR ); /* stops warnings */
typedef BOOL ( WINAPI * DEFPRINTER )( LPCTSTR ); /* stops warnings */
DEFPRINTER fnSetDefaultPrinter;
hWinSpool = LoadLibrary( TEXT( "winspool.drv" ) );
@@ -167,7 +167,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPTSTR lpPrinterName )
else /* NT4.0 or earlier */
{
/* Open this printer so you can get information about it. */
bFlag = OpenPrinter( lpPrinterName, &hPrinter, NULL );
bFlag = OpenPrinter( ( LPTSTR ) lpPrinterName, &hPrinter, NULL );
if( ! bFlag || ! hPrinter )
return HB_FALSE;
@@ -254,7 +254,7 @@ HB_FUNC( WIN_PRINTERSETDEFAULT )
{
void * hPrinterName;
hb_retl( hb_SetDefaultPrinter( ( LPTSTR ) HB_PARSTR( 1, &hPrinterName, NULL ) ) );
hb_retl( hb_SetDefaultPrinter( HB_PARSTR( 1, &hPrinterName, NULL ) ) );
hb_strfree( hPrinterName );
}

View File

@@ -86,7 +86,7 @@ HB_FUNC( WIN_REGCREATEKEYEX )
DWORD dwDisposition = 0;
hb_retl( RegCreateKeyEx( hb_regkeyconv( ( HB_PTRUINT ) hb_parnint( 1 ) ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hKey, NULL ),
HB_PARSTRDEF( 2, &hKey, NULL ),
0,
NULL,
hb_parnl( 5 ) /* dwOptions */,
@@ -107,7 +107,7 @@ HB_FUNC( WIN_REGOPENKEYEX )
HKEY hkResult = NULL;
hb_retl( RegOpenKeyEx( hb_regkeyconv( ( HB_PTRUINT ) hb_parnint( 1 ) ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hKey, NULL ),
HB_PARSTRDEF( 2, &hKey, NULL ),
0 /* dwOptions */,
hb_parnl( 4 ) /* samDesired */,
&hkResult ) == ERROR_SUCCESS );
@@ -189,7 +189,7 @@ HB_FUNC( WIN_REGSETVALUEEX )
{
DWORD nSpace = ( DWORD ) hb_parnl( 5 );
hb_retl( RegSetValueEx( ( HKEY ) hb_parptr( 1 ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hKey, NULL ),
HB_PARSTRDEF( 2, &hKey, NULL ),
0,
dwType,
( BYTE * ) &nSpace,
@@ -197,7 +197,7 @@ HB_FUNC( WIN_REGSETVALUEEX )
}
else
hb_retl( RegSetValueEx( ( HKEY ) hb_parptr( 1 ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hKey, NULL ),
HB_PARSTRDEF( 2, &hKey, NULL ),
0,
dwType,
( BYTE * ) hb_parcx( 5 ) /* cValue */,

View File

@@ -10,6 +10,8 @@
#xtranslate HBXBP_DEBUG( [<x,...>] ) => iif( .T.,, )
#endif
#define QT_PTROFXBP( oXbp ) ( oXbp:oWidget:pPtr )
/*----------------------------------------------------------------------*/
#include "hbqt.ch"

View File

@@ -1056,6 +1056,7 @@ EXTERNAL HB_THREADSTART
EXTERNAL HB_THREADJOIN
EXTERNAL HB_THREADDETACH
EXTERNAL HB_THREADONCE
EXTERNAL HB_THREADONCEINIT
EXTERNAL HB_THREADQUITREQUEST
EXTERNAL HB_THREADWAIT
EXTERNAL HB_THREADWAITFORALL