2012-11-04 14:41 UTC+0100 Viktor Szakats (harbour syenar.net)

* bin/find.hb
  * config/postinst.hb
  * utils/hbmk2/hbmk2.prg
    + missed to extract __HBEXTERN__* puller symbols from
      hbx file when assembling the list of public functions

  * utils/hbmk2/hbmk2.prg
    * only process stderr output for hints
    - disabled experimental library hinting feature. It hid
      the error output, which is not very desirable. I wonder
      if there is a way to channel a copy of the combined
      stderr/stdout output into a file, while letting them go
      to stderr/stdout also.

  * contrib/hbssl/hbssl.hbc
    + new HB_DYNBIND_OPENSSL .hbc option to dynamically bind
      hbssl library and its dependencies.

  - contrib/hbtip/hbtip.hbm
  - contrib/hbtip/hbtipssl.hbp
  * contrib/hbplist
  * contrib/hbtip/hbtip.hbc
  * contrib/hbtip/hbtip.hbp
  * contrib/hbtip/client.prg
  * contrib/hbtip/sendmail.prg
  * contrib/hbtip/tests/gmail.prg
    + changed the way SSL is supported in HBTIP. Now SSL
      functionality is dynamically enabled at runtime if
      HBSSL library is available. Static app will need
      to use 'REQUEST __HBEXTERN__HBSSL__' to force linkage.
      For scripts, add both '#require "hbssl"' and
      '#require "hbtip"'. Experimental.
      It simplifies build process, cleans all problems
      arising from having two different physical flavors
      of the same library.

  - contrib/hbhttpd/hbhttpds.hbp
  * contrib/hbhttpd/core.prg
  * contrib/hbhttpd/hbhttpd.hbc
  * contrib/hbhttpd/hbhttpd.hbp
  * contrib/hbhttpd/tests/eshop.prg
  * contrib/hbhttpd/tests/hbmk.hbm
  * contrib/hbplist
    + changed the way SSL is supported in HBTIP. Now SSL
      functionality is dynamically enabled at runtime if
      HBSSL library is available. Static app will need
      to use 'REQUEST __HBEXTERN__HBSSL__' to force linkage.
      For scripts, add both '#require "hbssl"' and
      '#require "hbhttpd"'. Experimental.
    + eshop.prg can now be run as hbrun script.
    ! fixed double pathsep in compile_file() causing server
      RTE when run as script

  * contrib/hbformat/utils/hbformat.prg
    + added #request so it now can be run as script

  * contrib/hbformat/hbfmtcls.prg
    + added two new methods to be able to format strings
      (as opposed to files).
    % optimized source loader to not load the file twice

  * doc/en/*.txt
    * hbformatted $EXAMPLES$, $TESTS$ (manual cherry picking)
      latest patched hbformat has an issue (reported)
      where it doesn't format when outside FUNC/PROC, these
      small code snippets are usually like that, so it causes
      a problem here.

  * contrib/gtwvg/*.c
    * run uncrustify again with the new settings
      (except on GTWVT derived code)

  * contrib/hbwin/*.[c|h]
    * cherry picked uncrustify formatting fixes
This commit is contained in:
Viktor Szakats
2012-11-04 13:48:43 +00:00
parent f1ad3f0e97
commit 55882ebf88
83 changed files with 3140 additions and 2999 deletions

View File

@@ -16,6 +16,82 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-11-04 14:41 UTC+0100 Viktor Szakats (harbour syenar.net)
* bin/find.hb
* config/postinst.hb
* utils/hbmk2/hbmk2.prg
+ missed to extract __HBEXTERN__* puller symbols from
hbx file when assembling the list of public functions
* utils/hbmk2/hbmk2.prg
* only process stderr output for hints
- disabled experimental library hinting feature. It hid
the error output, which is not very desirable. I wonder
if there is a way to channel a copy of the combined
stderr/stdout output into a file, while letting them go
to stderr/stdout also.
* contrib/hbssl/hbssl.hbc
+ new HB_DYNBIND_OPENSSL .hbc option to dynamically bind
hbssl library and its dependencies.
- contrib/hbtip/hbtip.hbm
- contrib/hbtip/hbtipssl.hbp
* contrib/hbplist
* contrib/hbtip/hbtip.hbc
* contrib/hbtip/hbtip.hbp
* contrib/hbtip/client.prg
* contrib/hbtip/sendmail.prg
* contrib/hbtip/tests/gmail.prg
+ changed the way SSL is supported in HBTIP. Now SSL
functionality is dynamically enabled at runtime if
HBSSL library is available. Static app will need
to use 'REQUEST __HBEXTERN__HBSSL__' to force linkage.
For scripts, add both '#require "hbssl"' and
'#require "hbtip"'. Experimental.
It simplifies build process, cleans all problems
arising from having two different physical flavors
of the same library.
- contrib/hbhttpd/hbhttpds.hbp
* contrib/hbhttpd/core.prg
* contrib/hbhttpd/hbhttpd.hbc
* contrib/hbhttpd/hbhttpd.hbp
* contrib/hbhttpd/tests/eshop.prg
* contrib/hbhttpd/tests/hbmk.hbm
* contrib/hbplist
+ changed the way SSL is supported in HBTIP. Now SSL
functionality is dynamically enabled at runtime if
HBSSL library is available. Static app will need
to use 'REQUEST __HBEXTERN__HBSSL__' to force linkage.
For scripts, add both '#require "hbssl"' and
'#require "hbhttpd"'. Experimental.
+ eshop.prg can now be run as hbrun script.
! fixed double pathsep in compile_file() causing server
RTE when run as script
* contrib/hbformat/utils/hbformat.prg
+ added #request so it now can be run as script
* contrib/hbformat/hbfmtcls.prg
+ added two new methods to be able to format strings
(as opposed to files).
% optimized source loader to not load the file twice
* doc/en/*.txt
* hbformatted $EXAMPLES$, $TESTS$ (manual cherry picking)
latest patched hbformat has an issue (reported)
where it doesn't format when outside FUNC/PROC, these
small code snippets are usually like that, so it causes
a problem here.
* contrib/gtwvg/*.c
* run uncrustify again with the new settings
(except on GTWVT derived code)
* contrib/hbwin/*.[c|h]
* cherry picked uncrustify formatting fixes
2012-11-03 19:22 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/pp/hbpp.c
! bumped copyright year to 2012

View File

@@ -75,17 +75,25 @@ STATIC PROCEDURE ProcessFile( cFileName, aContains )
RETURN
STATIC FUNCTION LoadHBX( cInputName )
STATIC FUNCTION LoadHBX( cFileName )
LOCAL cFile
LOCAL pRegex
LOCAL tmp
LOCAL aDynamic := {}
LOCAL cFilter
IF ! Empty( cFile := hb_MemoRead( cInputName ) ) .AND. ;
! Empty( pRegex := hb_regexComp( "^DYNAMIC ([a-zA-Z0-9_]*)$", .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
AAdd( aDynamic, tmp[ 2 ] )
IF ! Empty( cFile := hb_MemoRead( cFileName ) )
FOR EACH cFilter IN { ;
"^DYNAMIC ([a-zA-Z0-9_]*)$", ;
"ANNOUNCE ([a-zA-Z0-9_]*)$" }
IF ! Empty( pRegex := hb_regexComp( cFilter, .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
AAdd( aDynamic, tmp[ 2 ] )
NEXT
ENDIF
NEXT
ENDIF

View File

@@ -551,14 +551,22 @@ STATIC FUNCTION LoadHBX( cFileName, hAll )
LOCAL pRegex
LOCAL tmp
LOCAL aDynamic := {}
LOCAL cFilter
IF ! Empty( cFile := hb_MemoRead( cFileName ) ) .AND. ;
! Empty( pRegex := hb_regexComp( "^DYNAMIC ([a-zA-Z0-9_]*)$", .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
IF tmp[ 2 ] $ hAll
hAll[ tmp[ 2 ] ] += "," + cName
ELSE
hAll[ tmp[ 2 ] ] := cName
IF ! Empty( cFile := hb_MemoRead( cFileName ) )
FOR EACH cFilter IN { ;
"^DYNAMIC ([a-zA-Z0-9_]*)$", ;
"ANNOUNCE ([a-zA-Z0-9_]*)$" }
IF ! Empty( pRegex := hb_regexComp( cFilter, .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
IF tmp[ 2 ] $ hAll
hAll[ tmp[ 2 ] ] += "," + cName
ELSE
hAll[ tmp[ 2 ] ] := cName
ENDIF
NEXT
ENDIF
NEXT
ENDIF

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -70,7 +70,7 @@
/* workaround for missing declaration in MinGW32 */
#if ! defined( TTM_SETTITLE ) && defined( TTM_SETTITLEA )
#define TTM_SETTITLE TTM_SETTITLEA
#define TTM_SETTITLE TTM_SETTITLEA
#endif
#if defined( __MINGW32CE__ )
@@ -130,10 +130,10 @@ HB_FUNC( WVT_UTILS )
HB_FUNC( WVT_CHOOSEFONT )
{
#if ! defined( HB_OS_WIN_CE )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LONG PointSize = 0;
PHB_GTWVT _s = hb_wvt_gtGetWVT();
CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LONG PointSize = 0;
if( HB_ISNUM( 2 ) )
{
@@ -156,21 +156,21 @@ HB_FUNC( WVT_CHOOSEFONT )
hb_strfree( hText );
}
cf.lStructSize = sizeof( CHOOSEFONT );
cf.hwndOwner = _s->hWnd;
cf.hDC = ( HDC ) NULL;
cf.lpLogFont = &lf;
cf.iPointSize = 0;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT;
cf.rgbColors = RGB( 0, 0, 0 );
cf.lCustData = 0L;
cf.lpfnHook = ( LPCFHOOKPROC ) NULL;
cf.lpTemplateName = ( LPTSTR ) NULL;
cf.hInstance = ( HINSTANCE ) NULL;
cf.lpszStyle = ( LPTSTR ) NULL;
cf.nFontType = SCREEN_FONTTYPE;
cf.nSizeMin = 0;
cf.nSizeMax = 0;
cf.lStructSize = sizeof( CHOOSEFONT );
cf.hwndOwner = _s->hWnd;
cf.hDC = ( HDC ) NULL;
cf.lpLogFont = &lf;
cf.iPointSize = 0;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT;
cf.rgbColors = RGB( 0, 0, 0 );
cf.lCustData = 0L;
cf.lpfnHook = ( LPCFHOOKPROC ) NULL;
cf.lpTemplateName = ( LPTSTR ) NULL;
cf.hInstance = ( HINSTANCE ) NULL;
cf.lpszStyle = ( LPTSTR ) NULL;
cf.nFontType = SCREEN_FONTTYPE;
cf.nSizeMin = 0;
cf.nSizeMax = 0;
if( ChooseFont( &cf ) )
{
@@ -217,7 +217,7 @@ HB_FUNC( WVT_CHOOSEFONT )
*/
HB_FUNC( WVT_CHOOSECOLOR )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
CHOOSECOLOR cc;
COLORREF crCustClr[ 16 ];
@@ -228,11 +228,11 @@ HB_FUNC( WVT_CHOOSECOLOR )
crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) );
}
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = _s->hWnd;
cc.rgbResult = ( COLORREF ) hb_parnl( 1 );
cc.lpCustColors = crCustClr;
cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN );
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = _s->hWnd;
cc.rgbResult = ( COLORREF ) hb_parnl( 1 );
cc.lpCustColors = crCustClr;
cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN );
if( ChooseColor( &cc ) )
{
@@ -250,10 +250,11 @@ HB_FUNC( WVT_CHOOSECOLOR )
*/
HB_FUNC( WVT_MESSAGEBOX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
void * hTitle;
void * hMsg;
hb_retni( MessageBox( _s->hWnd, HB_PARSTR( 1, &hTitle, NULL ), HB_PARSTR( 2, &hMsg, NULL ), hb_parnidef( 3, MB_OK ) ) );
hb_strfree( hTitle );
hb_strfree( hMsg );
@@ -267,9 +268,9 @@ HB_FUNC( WVT_MESSAGEBOX )
HB_FUNC( WVT_SETTOOLTIPACTIVE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HB_BOOL bActive = _s->bToolTipActive;
HB_BOOL bActive = _s->bToolTipActive;
if( HB_ISLOG( 1 ) )
{
@@ -285,37 +286,37 @@ HB_FUNC( WVT_SETTOOLTIPACTIVE )
*/
HB_FUNC( WVT_SETTOOLTIP )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
TOOLINFO ti;
POINT xy = { 0, 0 };
int iTop, iLeft, iBottom, iRight;
TOOLINFO ti;
POINT xy = { 0, 0 };
int iTop, iLeft, iBottom, iRight;
if( ! _s->bToolTipActive )
return;
memset( &ti, 0, sizeof( ti ) );
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = _s->hWnd;
ti.uId = 100000;
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = _s->hWnd;
ti.uId = 100000;
if( SendMessage( _s->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
{
void * hText;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y - 1;
iRight = xy.x - 1;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y - 1;
iRight = xy.x - 1;
ti.lpszText = ( LPTSTR ) HB_PARSTR( 5, &hText, NULL );
ti.rect.left = iLeft;
ti.rect.top = iTop;
ti.rect.right = iRight;
ti.rect.bottom = iBottom;
ti.lpszText = ( LPTSTR ) HB_PARSTR( 5, &hText, NULL );
ti.rect.left = iLeft;
ti.rect.top = iTop;
ti.rect.right = iRight;
ti.rect.bottom = iBottom;
SendMessage( _s->hWndTT, TTM_SETTOOLINFO, 0, ( LPARAM ) &ti );
@@ -327,13 +328,13 @@ HB_FUNC( WVT_SETTOOLTIP )
HB_FUNC( WVT_SETTOOLTIPTEXT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
TOOLINFO ti;
PHB_GTWVT _s = hb_wvt_gtGetWVT();
TOOLINFO ti;
memset( &ti, 0, sizeof( ti ) );
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = _s->hWnd;
ti.uId = 100000;
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = _s->hWnd;
ti.uId = 100000;
if( SendMessage( _s->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
{
@@ -349,14 +350,14 @@ HB_FUNC( WVT_SETTOOLTIPTEXT )
HB_FUNC( WVT_SETTOOLTIPMARGIN )
{
#if ! defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT rc = { 0, 0, 0, 0 };
RECT rc = { 0, 0, 0, 0 };
rc.left = hb_parni( 2 );
rc.top = hb_parni( 1 );
rc.right = hb_parni( 4 );
rc.bottom = hb_parni( 3 );
rc.left = hb_parni( 2 );
rc.top = hb_parni( 1 );
rc.right = hb_parni( 4 );
rc.bottom = hb_parni( 3 );
SendMessage( _s->hWndTT, TTM_SETMARGIN, 0, ( LPARAM ) &rc );
#endif
@@ -367,9 +368,9 @@ HB_FUNC( WVT_SETTOOLTIPMARGIN )
HB_FUNC( WVT_SETTOOLTIPWIDTH )
{
#if ! defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTipWidth = ( int ) SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 );
int iTipWidth = ( int ) SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 );
if( HB_ISNUM( 1 ) )
{
@@ -385,9 +386,9 @@ HB_FUNC( WVT_SETTOOLTIPWIDTH )
HB_FUNC( WVT_SETTOOLTIPBKCOLOR )
{
#if ! defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 );
COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 );
if( HB_ISNUM( 1 ) )
SendMessage( _s->hWndTT, TTM_SETTIPBKCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 1 ), 0 );
@@ -401,9 +402,9 @@ HB_FUNC( WVT_SETTOOLTIPBKCOLOR )
HB_FUNC( WVT_SETTOOLTIPTEXTCOLOR )
{
#if ! defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 );
COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 );
if( HB_ISNUM( 1 ) )
SendMessage( _s->hWndTT, TTM_SETTIPTEXTCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 1 ), 0 );
@@ -418,9 +419,9 @@ HB_FUNC( WVT_SETTOOLTIPTEXTCOLOR )
HB_FUNC( WVT_SETTOOLTIPTITLE )
{
#if ! defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iIcon;
int iIcon;
if( HB_ISCHAR( 2 ) )
{
@@ -474,9 +475,9 @@ HB_FUNC( WVT_GETTOOLTIPTEXTCOLOR )
HB_FUNC( WVT_SETGUI )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HB_BOOL bGui = _s->bGui;
HB_BOOL bGui = _s->bGui;
if( HB_ISLOG( 1 ) )
_s->bGui = hb_parl( 1 );
@@ -488,9 +489,9 @@ HB_FUNC( WVT_SETGUI )
HB_FUNC( WVT_SETMOUSEPOS )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0, 0 };
POINT xy = { 0, 0 };
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
@@ -504,9 +505,9 @@ HB_FUNC( WVT_SETMOUSEPOS )
HB_FUNC( WVT_GETPAINTRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 4 );
PHB_ITEM info = hb_itemArrayNew( 4 );
hb_arraySetNI( info, 1, _s->rowStart );
hb_arraySetNI( info, 2, _s->colStart );
@@ -520,10 +521,10 @@ HB_FUNC( WVT_GETPAINTRECT )
HB_FUNC( WVT_SETPOINTER )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iCursor = hb_parni( 1 );
HCURSOR hCursor;
int iCursor = hb_parni( 1 );
HCURSOR hCursor;
switch( iCursor )
{
@@ -608,9 +609,9 @@ HB_FUNC( WVT_SETPOINTER )
HB_FUNC( WVT_SETMOUSEMOVE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HB_BOOL bMouseMove = _s->MouseMove;
HB_BOOL bMouseMove = _s->MouseMove;
if( HB_ISLOG( 1 ) )
_s->MouseMove = hb_parl( 1 );
@@ -637,9 +638,9 @@ HB_FUNC( WVT_GETXYFROMROWCOL )
HB_FUNC( WVT_GETFONTINFO )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 7 );
PHB_ITEM info = hb_itemArrayNew( 7 );
HB_ARRAYSETSTR( info, 1, _s->fontFace );
hb_arraySetNL( info, 2, _s->fontHeight );
@@ -664,20 +665,20 @@ HB_FUNC( WVT_GETFONTINFO )
HB_FUNC( WVT_SETMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT wi = { 0, 0, 0, 0 };
RECT ci = { 0, 0, 0, 0 };
RECT rc = { 0, 0, 0, 0 };
int height, width;
RECT wi = { 0, 0, 0, 0 };
RECT ci = { 0, 0, 0, 0 };
RECT rc = { 0, 0, 0, 0 };
int height, width;
SetMenu( _s->hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ) );
GetWindowRect( _s->hWnd, &wi );
GetClientRect( _s->hWnd, &ci );
height = ( int ) ( _s->PTEXTSIZE.y * _s->ROWS );
width = ( int ) ( _s->PTEXTSIZE.x * _s->COLS );
height = ( int ) ( _s->PTEXTSIZE.y * _s->ROWS );
width = ( int ) ( _s->PTEXTSIZE.x * _s->COLS );
width += ( int ) ( wi.right - wi.left - ci.right );
height += ( int ) ( wi.bottom - wi.top - ci.bottom );
@@ -694,9 +695,9 @@ HB_FUNC( WVT_SETMENU )
HB_FUNC( WVT_SETPOPUPMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HMENU hPopup = _s->hPopup;
HMENU hPopup = _s->hPopup;
_s->hPopup = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 );
if( hPopup )
@@ -757,9 +758,9 @@ HB_FUNC( WVT_GETLASTMENUEVENT )
HB_FUNC( WVT_SETLASTMENUEVENT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iEvent = _s->LastMenuEvent;
int iEvent = _s->LastMenuEvent;
if( HB_ISNUM( 1 ) )
_s->LastMenuEvent = hb_parni( 1 );
@@ -771,9 +772,9 @@ HB_FUNC( WVT_SETLASTMENUEVENT )
HB_FUNC( WVT_SETMENUKEYEVENT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iOldEvent = _s->MenuKeyEvent;
int iOldEvent = _s->MenuKeyEvent;
if( HB_ISNUM( 1 ) )
_s->MenuKeyEvent = hb_parni( 1 );
@@ -794,9 +795,9 @@ HB_FUNC( WVT_DRAWMENUBAR )
HB_FUNC( WVT_ENABLESHORTCUTS )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HB_BOOL bWas = _s->EnableShortCuts;
HB_BOOL bWas = _s->EnableShortCuts;
if( HB_ISLOG( 1 ) )
_s->EnableShortCuts = hb_parl( 1 );
@@ -808,17 +809,17 @@ HB_FUNC( WVT_ENABLESHORTCUTS )
HB_FUNC( WVT_INVALIDATERECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT rc = { 0, 0, 0, 0 };
POINT xy = { 0, 0 };
RECT rc = { 0, 0, 0, 0 };
POINT xy = { 0, 0 };
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
rc.top = xy.y;
rc.left = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
rc.bottom = xy.y - 1;
rc.right = xy.x - 1;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
rc.top = xy.y;
rc.left = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
rc.bottom = xy.y - 1;
rc.right = xy.x - 1;
InvalidateRect( _s->hWnd, &rc, TRUE );
}
@@ -834,10 +835,10 @@ HB_FUNC( WVT_ISLBUTTONPRESSED )
HB_FUNC( WVT_CLIENTTOSCREEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 2 );
POINT xy = { 0, 0 };
PHB_ITEM info = hb_itemArrayNew( 2 );
POINT xy = { 0, 0 };
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
@@ -868,9 +869,9 @@ HB_FUNC( WVT_GETCURSORPOS )
HB_FUNC( WVT_TRACKPOPUPMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0, 0 };
POINT xy = { 0, 0 };
GetCursorPos( &xy );
@@ -904,15 +905,15 @@ HB_FUNC( WVT_GETMENU )
HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY );
PHB_ITEM pFunc = NULL;
PHB_DYNS pExecSym;
HWND hDlg = 0;
int iType = 0;
int iIndex;
int iResource = hb_parni( 4 );
PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY );
PHB_ITEM pFunc = NULL;
PHB_DYNS pExecSym;
HWND hDlg = 0;
int iType = 0;
int iIndex;
int iResource = hb_parni( 4 );
/* check if we still have room for a new dialog */
for( iIndex = 0; iIndex < WVT_DLGML_MAX; iIndex++ )
@@ -933,8 +934,8 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
if( HB_IS_BLOCK( pFirst ) )
{
/* pFunc is pointing to stored code block (later) */
pFunc = hb_itemNew( pFirst );
iType = 2;
pFunc = hb_itemNew( pFirst );
iType = 2;
}
else if( hb_itemType( pFirst ) == HB_IT_STRING )
{
@@ -1027,15 +1028,15 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
HB_FUNC( WVT_CREATEDIALOGMODAL )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY );
PHB_ITEM pFunc = NULL;
PHB_DYNS pExecSym;
int iIndex;
int iResource = hb_parni( 4 );
HB_PTRDIFF iResult = 0;
HWND hParent = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : _s->hWnd;
PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY );
PHB_ITEM pFunc = NULL;
PHB_DYNS pExecSym;
int iIndex;
int iResource = hb_parni( 4 );
HB_PTRDIFF iResult = 0;
HWND hParent = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : _s->hWnd;
/* check if we still have room for a new dialog */
for( iIndex = 0; iIndex < WVT_DLGMD_MAX; iIndex++ )
@@ -1055,11 +1056,11 @@ HB_FUNC( WVT_CREATEDIALOGMODAL )
{
/* pFunc is pointing to stored code block (later) */
_s->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst );
_s->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst );
pFunc = _s->pcbFuncModal[ iIndex ];
_s->pFuncModal[ iIndex ] = pFunc;
_s->iTypeModal[ iIndex ] = 2;
pFunc = _s->pcbFuncModal[ iIndex ];
_s->pFuncModal[ iIndex ] = pFunc;
_s->iTypeModal[ iIndex ] = 2;
}
else if( hb_itemType( pFirst ) == HB_IT_STRING )
{
@@ -1068,8 +1069,8 @@ HB_FUNC( WVT_CREATEDIALOGMODAL )
{
pFunc = ( PHB_ITEM ) pExecSym;
}
_s->pFuncModal[ iIndex ] = pFunc;
_s->iTypeModal[ iIndex ] = 1;
_s->pFuncModal[ iIndex ] = pFunc;
_s->iTypeModal[ iIndex ] = 1;
}
switch( iResource )
@@ -1111,10 +1112,10 @@ HB_FUNC( WVT_CREATEDIALOGMODAL )
HB_FUNC( WVT__MAKEDLGTEMPLATE )
{
WORD * p, * pdlgtemplate;
WORD nItems = ( WORD ) hb_parvni( 1, 4 );
int i, nchar;
DWORD lStyle;
WORD * p, * pdlgtemplate;
WORD nItems = ( WORD ) hb_parvni( 1, 4 );
int i, nchar;
DWORD lStyle;
/* Parameters: 12 arrays */
/* 1 for DLG template */
@@ -1122,9 +1123,9 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
/* 64k allow to build up to 255 items on the dialog */
/* */
pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 );
pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 );
lStyle = hb_parvnl( 1, 3 );
lStyle = hb_parvnl( 1, 3 );
/* start to fill in the dlgtemplate information. addressing by WORDs */
@@ -1149,8 +1150,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
if( hb_parinfa( 1, 11 ) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 11 ) );
p += nchar;
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 11 ) );
p += nchar;
}
else
{
@@ -1160,18 +1161,18 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
if( ( lStyle & DS_SETFONT ) )
{
*p++ = ( short ) hb_parvni( 1, 12 );
*p++ = ( short ) hb_parvni( 1, 13 );
*p++ = ( short ) hb_parvni( 1, 14 );
*p++ = ( short ) hb_parvni( 1, 12 );
*p++ = ( short ) hb_parvni( 1, 13 );
*p++ = ( short ) hb_parvni( 1, 14 );
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 15 ) );
p += nchar;
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 15 ) );
p += nchar;
}
for( i = 1; i <= nItems; i++ )
{
/* make sure each item starts on a DWORD boundary */
p = lpwAlign( p );
p = lpwAlign( p );
*p++ = LOWORD( hb_parvnl( 2, i ) ); /* help id */
*p++ = HIWORD( hb_parvnl( 2, i ) );
@@ -1192,8 +1193,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
if( hb_parinfa( 10, i ) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 10, i ) ); /* class */
p += nchar;
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 10, i ) ); /* class */
p += nchar;
}
else
{
@@ -1203,8 +1204,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
if( hb_parinfa( 11, i ) == HB_IT_STRING )
{
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 11, i ) ); /* text */
p += nchar;
nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 11, i ) ); /* text */
p += nchar;
}
else
{
@@ -1258,6 +1259,7 @@ int nCopyAnsiToWideChar( LPWORD lpWCStr, LPCSTR lpAnsiIn )
HB_FUNC( WVT_LBADDSTRING )
{
void * hText;
SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), LB_ADDSTRING, 0, ( LPARAM ) HB_PARSTR( 3, &hText, NULL ) );
hb_strfree( hText );
}
@@ -1288,6 +1290,7 @@ HB_FUNC( WVT_LBSETCURSEL )
HB_FUNC( WVT_CBADDSTRING )
{
void * hText;
SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), CB_ADDSTRING, 0, ( LPARAM ) HB_PARSTR( 3, &hText, NULL ) );
hb_strfree( hText );
}
@@ -1337,10 +1340,10 @@ HB_FUNC( WVT_DLGSETICON )
HB_FUNC( WVT_GETFONTHANDLE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HFONT hFont = 0;
int iSlot = hb_parni( 1 ) - 1;
HFONT hFont = 0;
int iSlot = hb_parni( 1 ) - 1;
if( iSlot >= 0 && iSlot < WVT_PICTURES_MAX )
hFont = _s->pGUI->hUserFonts[ iSlot ];
@@ -1391,8 +1394,8 @@ HB_BOOL wvt_Array2Point( PHB_ITEM aPoint, POINT * pt )
{
if( HB_IS_ARRAY( aPoint ) && hb_arrayLen( aPoint ) == 2 )
{
pt->x = hb_arrayGetNL( aPoint, 1 );
pt->y = hb_arrayGetNL( aPoint, 2 );
pt->x = hb_arrayGetNL( aPoint, 1 );
pt->y = hb_arrayGetNL( aPoint, 2 );
return HB_TRUE;
}
return HB_FALSE;

View File

@@ -84,7 +84,7 @@
#endif
#if ! defined( CB_GETCOMBOBOXINFO )
# define CB_GETCOMBOBOXINFO 0x0164
# define CB_GETCOMBOBOXINFO 0x0164
#endif
#define WIN_STATUSBAR_MAX_PARTS 256
@@ -124,8 +124,8 @@ static HINSTANCE wvg_hInstance( void )
HB_FUNC( WVG_SENDMESSAGE )
{
void * hText = NULL;
HB_SIZE nLen = 0;
void * hText = NULL;
HB_SIZE nLen = 0;
LPCTSTR lpText = HB_PARSTR( 4, &hText, &nLen );
if( lpText && HB_ISBYREF( 4 ) )
@@ -145,14 +145,14 @@ HB_FUNC( WVG_SENDMESSAGE )
HB_FUNC( WVG_SENDDLGITEMMESSAGE )
{
PHB_ITEM pText = hb_param( 5, HB_IT_STRING );
char * cText = NULL;
HB_ISIZ iLen = 0;
PHB_ITEM pText = hb_param( 5, HB_IT_STRING );
char * cText = NULL;
HB_ISIZ iLen = 0;
if( pText )
{
iLen = hb_itemGetCLen( pText );
cText = ( char * ) hb_xgrab( iLen + 1 );
iLen = hb_itemGetCLen( pText );
cText = ( char * ) hb_xgrab( iLen + 1 );
hb_xmemcpy( cText, hb_itemGetCPtr( pText ), iLen + 1 );
}
@@ -261,6 +261,7 @@ HB_FUNC( WVG_GETDIALOGBASEUNITS )
HB_FUNC( WVG_SETDLGITEMTEXT )
{
void * hText;
SetDlgItemText( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ), HB_PARSTR( 3, &hText, NULL ) );
hb_strfree( hText );
}
@@ -269,9 +270,9 @@ HB_FUNC( WVG_SETDLGITEMTEXT )
HB_FUNC( WVG_GETDLGITEMTEXT )
{
int iLen = ( int ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1;
LPTSTR cText = ( LPTSTR ) hb_xgrab( iLen * sizeof( TCHAR ) );
UINT iResult;
int iLen = ( int ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1;
LPTSTR cText = ( LPTSTR ) hb_xgrab( iLen * sizeof( TCHAR ) );
UINT iResult;
iResult = GetDlgItemText( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), /* handle of dialog box */
hb_parni( 2 ), /* identifier of control */
@@ -324,6 +325,7 @@ HB_FUNC( WVG_MESSAGEBOX )
HWND hWnd = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow();
void * hMsg;
void * hTitle;
hb_retni( MessageBox( hWnd, HB_PARSTR( 2, &hMsg, NULL ), HB_PARSTR( 3, &hTitle, NULL ), hb_parnidef( 4, MB_OK ) ) );
hb_strfree( hMsg );
hb_strfree( hTitle );
@@ -337,10 +339,10 @@ HB_FUNC( WVG_INVALIDATERECT )
{
RECT rc = { 0, 0, 0, 0 };
rc.left = hb_parvni( 2, 1 );
rc.top = hb_parvni( 2, 2 );
rc.right = hb_parvni( 2, 3 );
rc.bottom = hb_parvni( 2, 4 );
rc.left = hb_parvni( 2, 1 );
rc.top = hb_parvni( 2, 2 );
rc.right = hb_parvni( 2, 3 );
rc.bottom = hb_parvni( 2, 4 );
hb_retl( InvalidateRect( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), &rc, TRUE ) );
}
@@ -379,10 +381,10 @@ HB_FUNC( WVG_LOADICON )
*/
HB_FUNC( WVG_LOADIMAGE )
{
HANDLE hImage = 0;
void * hBuffer;
LPCTSTR lpBuffer = HB_PARSTR( 1, &hBuffer, NULL );
int iSource = hb_parni( 2 );
HANDLE hImage = 0;
void * hBuffer;
LPCTSTR lpBuffer = HB_PARSTR( 1, &hBuffer, NULL );
int iSource = hb_parni( 2 );
switch( iSource )
{
@@ -430,6 +432,7 @@ HB_FUNC( WVG_GETCLIENTRECT )
HB_FUNC( WVG_DRAWIMAGE )
{
void * hImage;
hb_retl( hb_wvt_DrawImage( ( HDC ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ), hb_parni( 3 ),
hb_parni( 4 ), hb_parni( 5 ), HB_PARSTR( 6, &hImage, NULL ) ) );
hb_strfree( hImage );
@@ -468,14 +471,14 @@ HB_FUNC( WVG_CREATEBRUSH )
*/
HB_FUNC( WVG_DRAWTEXT )
{
RECT rc = { 0, 0, 0, 0 };
void * hBuffer;
LPCTSTR lpBuffer = HB_PARSTR( 2, &hBuffer, NULL );
RECT rc = { 0, 0, 0, 0 };
void * hBuffer;
LPCTSTR lpBuffer = HB_PARSTR( 2, &hBuffer, NULL );
rc.left = hb_parvni( 3, 1 );
rc.top = hb_parvni( 3, 2 );
rc.right = hb_parvni( 3, 3 );
rc.bottom = hb_parvni( 3, 4 );
rc.left = hb_parvni( 3, 1 );
rc.top = hb_parvni( 3, 2 );
rc.right = hb_parvni( 3, 3 );
rc.bottom = hb_parvni( 3, 4 );
hb_retl( DrawText( ( HDC ) ( HB_PTRDIFF ) hb_parnint( 1 ), lpBuffer, lstrlen( lpBuffer ), &rc, hb_parni( 4 ) ) );
hb_strfree( hBuffer );
@@ -540,6 +543,7 @@ HB_FUNC( WVG_SETFOREGROUNDWINDOW )
HB_FUNC( WVG_SETWINDOWTEXT )
{
void * hText;
SetWindowText( wvg_parhwnd( 1 ), HB_PARSTR( 2, &hText, NULL ) );
hb_strfree( hText );
}
@@ -639,13 +643,13 @@ HB_FUNC( WVG_NOT )
HB_FUNC( WVG_TRACKPOPUPMENU )
{
HMENU hMenu = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 );
UINT uFlags = hb_parnldef( 2, TPM_CENTERALIGN | TPM_RETURNCMD );
int x = hb_parni( 3 );
int y = hb_parni( 4 );
HWND hWnd = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : GetActiveWindow();
HMENU hMenu = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 );
UINT uFlags = hb_parnldef( 2, TPM_CENTERALIGN | TPM_RETURNCMD );
int x = hb_parni( 3 );
int y = hb_parni( 4 );
HWND hWnd = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : GetActiveWindow();
POINT xy = { 0, 0 };
POINT xy = { 0, 0 };
if( ! HB_ISNUM( 3 ) )
{
@@ -671,11 +675,11 @@ HB_FUNC( WVG_CHOOSECOLOR )
for( i = 0; i < ( int ) HB_SIZEOFARRAY( crCustClr ); i++ )
crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) );
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = HB_ISNUM( 4 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 4 ) : NULL;
cc.rgbResult = ( COLORREF ) hb_parnl( 1 );
cc.lpCustColors = crCustClr;
cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN );
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = HB_ISNUM( 4 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 4 ) : NULL;
cc.rgbResult = ( COLORREF ) hb_parnl( 1 );
cc.lpCustColors = crCustClr;
cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN );
if( ChooseColor( &cc ) )
hb_retnl( cc.rgbResult );
@@ -687,10 +691,10 @@ HB_FUNC( WVG_CHOOSECOLOR )
HB_FUNC( WVG_FINDWINDOW )
{
HWND hwnd;
void * hText;
HWND hwnd;
void * hText;
hwnd = FindWindow( NULL, HB_PARSTR( 1, &hText, NULL ) );
hwnd = FindWindow( NULL, HB_PARSTR( 1, &hText, NULL ) );
hb_strfree( hText );
if( hwnd )
@@ -712,20 +716,20 @@ HB_FUNC( WVG_SLEEP )
HB_FUNC( WVG_SETMENU )
{
HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
#if 1
HB_BOOL bSet;
RECT wi = { 0, 0, 0, 0 };
RECT ci = { 0, 0, 0, 0 };
int height, width;
HB_BOOL bSet;
RECT wi = { 0, 0, 0, 0 };
RECT ci = { 0, 0, 0, 0 };
int height, width;
bSet = SetMenu( hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 2 ) );
GetWindowRect( hWnd, &wi );
GetClientRect( hWnd, &ci );
height = ( ci.bottom - ci.top );
width = ( ci.right - ci.left );
height = ( ci.bottom - ci.top );
width = ( ci.right - ci.left );
width += ( wi.right - wi.left - ci.right );
height += ( wi.bottom - wi.top - ci.bottom );
@@ -787,7 +791,7 @@ HB_FUNC( WVG_INSERTMENU )
else /* It is a SEPARATOR or Submenu */
{
LPCTSTR lpszCaption = ( LPCTSTR ) ( HB_PTRDIFF ) hb_parnint( 5 );
hb_retl( InsertMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ),
hb_retl( InsertMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ),
flags, ( HB_PTRDIFF ) hb_parnint( 4 ), ( LPCTSTR ) lpszCaption ) );
}
}
@@ -829,7 +833,7 @@ HB_FUNC( WVG_ISMENUITEMCHECKED )
memset( &lpmii, 0, sizeof( MENUITEMINFO ) );
lpmii.cbSize = sizeof( MENUITEMINFO );
lpmii.fMask = MIIM_STATE;
lpmii.fMask = MIIM_STATE;
lSuccess = GetMenuItemInfo( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), TRUE, &lpmii );
if( lSuccess )
@@ -848,7 +852,7 @@ HB_FUNC( WVG_ISMENUITEMENABLED )
MENUITEMINFO lpmii;
lpmii.cbSize = sizeof( MENUITEMINFO );
lpmii.fMask = MIIM_STATE;
lpmii.fMask = MIIM_STATE;
lSuccess = GetMenuItemInfo( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), TRUE, &lpmii );
if( lSuccess )
@@ -863,11 +867,11 @@ HB_FUNC( WVG_SETMENUITEM )
{
BOOL lSuccess;
MENUITEMINFO lpmii;
void * hText = NULL;
void * hText = NULL;
memset( &lpmii, 0, sizeof( MENUITEMINFO ) );
lpmii.cbSize = sizeof( MENUITEMINFO );
lpmii.fMask = hb_parl( 5 ) ? MIIM_STRING : MIIM_SUBMENU;
lpmii.fMask = hb_parl( 5 ) ? MIIM_STRING : MIIM_SUBMENU;
if( hb_parl( 5 ) )
lpmii.dwTypeData = ( LPTSTR ) HB_PARSTR( 4, &hText, NULL );
@@ -934,6 +938,7 @@ HB_FUNC( WVG_CREATEWINDOWEX )
HB_FUNC( WVG_SENDMESSAGETEXT )
{
void * hBuffer;
SendMessage( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ),
hb_parni( 2 ),
( WPARAM ) hb_parni( 3 ),
@@ -956,9 +961,9 @@ HB_FUNC( WVG_GETMESSAGETEXT )
HB_FUNC( WVG_SETWNDPROC )
{
HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
WNDPROC wndProc = ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( 2 );
WNDPROC oldProc;
HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
WNDPROC wndProc = ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( 2 );
WNDPROC oldProc;
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) || defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT )
oldProc = ( WNDPROC ) SetWindowLong( hWnd, GWL_WNDPROC, ( long ) wndProc );
@@ -1201,7 +1206,7 @@ HB_FUNC( WVG_POSTMESSAGE )
HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES )
{
#if ( _WIN32_WINNT >= 0x0500 )
HINSTANCE h;
HINSTANCE h;
wvtSetLayeredWindowAttributes pfnLayered;
h = GetModuleHandle( TEXT( "user32.dll" ) );
@@ -1230,8 +1235,8 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES )
HB_FUNC( WVG_SENDTOOLBARMESSAGE )
{
/* #if ! defined( HB_OS_WIN_CE ) */
HWND hTB = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
HWND hTB = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
switch( msg )
{
@@ -1241,9 +1246,9 @@ HB_FUNC( WVG_SENDTOOLBARMESSAGE )
tbab.hInst = NULL;
#if ( _WIN32_IE >= 0x0500 )
tbab.nID = ( UINT_PTR ) hbwapi_par_raw_HBITMAP( 3 );
tbab.nID = ( UINT_PTR ) hbwapi_par_raw_HBITMAP( 3 );
#else
tbab.nID = ( UINT ) hbwapi_par_raw_HBITMAP( 3 );
tbab.nID = ( UINT ) hbwapi_par_raw_HBITMAP( 3 );
#endif
hbwapi_ret_NI( ( int ) SendMessage( hTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ) );
break;
@@ -1385,11 +1390,11 @@ HB_FUNC( WVG_SENDTOOLBARMESSAGE )
break;
case TB_GETCOLORSCHEME:
{
PHB_ITEM info = hb_itemArrayNew( 2 );
PHB_ITEM info = hb_itemArrayNew( 2 );
COLORSCHEME colorScheme;
colorScheme.dwSize = sizeof( COLORSCHEME );
SendMessage( hTB, TB_GETCOLORSCHEME, ( WPARAM ) 0, ( LPARAM ) & colorScheme );
SendMessage( hTB, TB_GETCOLORSCHEME, ( WPARAM ) 0, ( LPARAM ) &colorScheme );
hb_arraySetNInt( info, 1, colorScheme.clrBtnHighlight );
hb_arraySetNInt( info, 2, colorScheme.clrBtnShadow );
@@ -1418,8 +1423,8 @@ HB_FUNC( WVG_SENDTOOLBARMESSAGE )
HB_FUNC( WVG_SENDEDITCONTROLMESSAGE )
{
HWND hED = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
HWND hED = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
switch( msg )
{
@@ -1437,197 +1442,197 @@ HB_FUNC( WVG_SENDEDITCONTROLMESSAGE )
HB_FUNC( WVG_SENDCBMESSAGE )
{
HWND hCB = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
HWND hCB = hbwapi_par_raw_HWND( 1 );
int msg = hbwapi_par_INT( 2 );
void * hText = NULL;
switch( msg )
{
case CB_ADDSTRING : // Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted.
hb_retnint( SendMessage( hCB, CB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) ( LPCTSTR ) HB_PARSTR( 3, &hText, NULL ) ) );
break;
case CB_DELETESTRING : // Deletes a string in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_DELETESTRING, hb_parni( 3 ), 0 ) );
break;
case CB_DIR : // Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list.
hb_retnint( SendMessage( hCB, CB_DIR, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_FINDSTRING : // Searches the list box of a combo box for an item beginning with the characters in a specified string.
hb_retnint( SendMessage( hCB, CB_FINDSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_FINDSTRINGEXACT : // Finds the first list box string in a combo box that matches the string specified in the lParam parameter.
hb_retnint( SendMessage( hCB, CB_FINDSTRINGEXACT, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_GETCOMBOBOXINFO : // Gets information about the specified combo box.
{
COMBOBOXINFO cbi;
PHB_ITEM pCbi = hb_itemNew( NULL );
PHB_ITEM pRc1 = hb_itemNew( NULL );
PHB_ITEM pRc2 = hb_itemNew( NULL );
memset( &cbi, 0, sizeof( COMBOBOXINFO ) );
cbi.cbSize = sizeof( COMBOBOXINFO );
if( GetComboBoxInfo( hCB, &cbi ) )
case CB_ADDSTRING: // Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted.
hb_retnint( SendMessage( hCB, CB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) ( LPCTSTR ) HB_PARSTR( 3, &hText, NULL ) ) );
break;
case CB_DELETESTRING: // Deletes a string in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_DELETESTRING, hb_parni( 3 ), 0 ) );
break;
case CB_DIR: // Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list.
hb_retnint( SendMessage( hCB, CB_DIR, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_FINDSTRING: // Searches the list box of a combo box for an item beginning with the characters in a specified string.
hb_retnint( SendMessage( hCB, CB_FINDSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_FINDSTRINGEXACT: // Finds the first list box string in a combo box that matches the string specified in the lParam parameter.
hb_retnint( SendMessage( hCB, CB_FINDSTRINGEXACT, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_GETCOMBOBOXINFO: // Gets information about the specified combo box.
{
hb_arrayNew( pCbi, 6 );
hb_arrayNew( pRc1, 4 );
hb_arrayNew( pRc2, 4 );
COMBOBOXINFO cbi;
PHB_ITEM pCbi = hb_itemNew( NULL );
PHB_ITEM pRc1 = hb_itemNew( NULL );
PHB_ITEM pRc2 = hb_itemNew( NULL );
hb_arraySetNI( pRc1, 1, cbi.rcItem.left );
hb_arraySetNI( pRc1, 2, cbi.rcItem.top );
hb_arraySetNI( pRc1, 3, cbi.rcItem.right );
hb_arraySetNI( pRc1, 4, cbi.rcItem.bottom );
memset( &cbi, 0, sizeof( COMBOBOXINFO ) );
cbi.cbSize = sizeof( COMBOBOXINFO );
hb_arraySet( pCbi, 1, pRc1 );
if( GetComboBoxInfo( hCB, &cbi ) )
{
hb_arrayNew( pCbi, 6 );
hb_arrayNew( pRc1, 4 );
hb_arrayNew( pRc2, 4 );
hb_arraySetNI( pRc2, 1, cbi.rcButton.left );
hb_arraySetNI( pRc2, 2, cbi.rcButton.top );
hb_arraySetNI( pRc2, 3, cbi.rcButton.right );
hb_arraySetNI( pRc2, 4, cbi.rcButton.bottom );
hb_arraySetNI( pRc1, 1, cbi.rcItem.left );
hb_arraySetNI( pRc1, 2, cbi.rcItem.top );
hb_arraySetNI( pRc1, 3, cbi.rcItem.right );
hb_arraySetNI( pRc1, 4, cbi.rcItem.bottom );
hb_arraySet( pCbi, 2, pRc2 );
hb_arraySet( pCbi, 1, pRc1 );
hb_arraySetNInt( pCbi, 3, cbi.stateButton );
hb_arraySetNInt( pCbi, 4, ( HB_PTRDIFF ) cbi.hwndCombo );
hb_arraySetNInt( pCbi, 5, ( HB_PTRDIFF ) cbi.hwndItem );
hb_arraySetNInt( pCbi, 6, ( HB_PTRDIFF ) cbi.hwndList );
hb_arraySetNI( pRc2, 1, cbi.rcButton.left );
hb_arraySetNI( pRc2, 2, cbi.rcButton.top );
hb_arraySetNI( pRc2, 3, cbi.rcButton.right );
hb_arraySetNI( pRc2, 4, cbi.rcButton.bottom );
hb_itemReturnRelease( pCbi );
hb_itemRelease( pRc1 );
hb_itemRelease( pRc2 );
hb_arraySet( pCbi, 2, pRc2 );
hb_arraySetNInt( pCbi, 3, cbi.stateButton );
hb_arraySetNInt( pCbi, 4, ( HB_PTRDIFF ) cbi.hwndCombo );
hb_arraySetNInt( pCbi, 5, ( HB_PTRDIFF ) cbi.hwndItem );
hb_arraySetNInt( pCbi, 6, ( HB_PTRDIFF ) cbi.hwndList );
hb_itemReturnRelease( pCbi );
hb_itemRelease( pRc1 );
hb_itemRelease( pRc2 );
}
break;
}
break;
}
case CB_GETCOUNT : // Gets the number of items in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_GETCOUNT, 0, 0 ) );
break;
case CB_GETCOUNT: // Gets the number of items in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_GETCOUNT, 0, 0 ) );
break;
#if defined( CB_GETCUEBANNER )
case CB_GETCUEBANNER : // Gets the cue banner text displayed in the edit control of a combo box. Send this message explicitly or by using the ComboBox_GetCueBannerText macro.
break;
case CB_GETCUEBANNER: // Gets the cue banner text displayed in the edit control of a combo box. Send this message explicitly or by using the ComboBox_GetCueBannerText macro.
break;
#endif
case CB_GETCURSEL : // An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, if any, in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_GETCURSEL, 0, 0 ) );
break;
case CB_GETDROPPEDCONTROLRECT : // An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a combo box in its dropped-down state.
{
RECT rc;
PHB_ITEM pRect = hb_itemNew( NULL );
case CB_GETCURSEL: // An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, if any, in the list box of a combo box.
hb_retnint( SendMessage( hCB, CB_GETCURSEL, 0, 0 ) );
break;
case CB_GETDROPPEDCONTROLRECT: // An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a combo box in its dropped-down state.
{
RECT rc;
PHB_ITEM pRect = hb_itemNew( NULL );
SendMessage( hCB, CB_GETDROPPEDCONTROLRECT, 0, ( LPARAM ) &rc );
SendMessage( hCB, CB_GETDROPPEDCONTROLRECT, 0, ( LPARAM ) &rc );
hb_arrayNew( pRect, 4 );
hb_arraySetNI( pRect, 1, rc.left );
hb_arraySetNI( pRect, 2, rc.top );
hb_arraySetNI( pRect, 3, rc.right );
hb_arraySetNI( pRect, 4, rc.bottom );
hb_arrayNew( pRect, 4 );
hb_arraySetNI( pRect, 1, rc.left );
hb_arraySetNI( pRect, 2, rc.top );
hb_arraySetNI( pRect, 3, rc.right );
hb_arraySetNI( pRect, 4, rc.bottom );
hb_itemReturnRelease( pRect );
break;
}
case CB_GETDROPPEDSTATE : // Determines whether the list box of a combo box is dropped down.
hb_retnint( SendMessage( hCB, CB_GETDROPPEDSTATE, 0, 0 ) );
break;
case CB_GETDROPPEDWIDTH : // Gets the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
hb_retnint( SendMessage( hCB, CB_GETDROPPEDWIDTH, 0, 0 ) );
break;
case CB_GETEDITSEL : // Gets the starting and ending character positions of the current selection in the edit control of a combo box.
{
DWORD range = ( DWORD ) SendMessage( hCB, CB_GETEDITSEL, ( WPARAM ) NULL, ( LPARAM ) NULL );
PHB_ITEM pRng = hb_itemNew( NULL );
hb_itemReturnRelease( pRect );
break;
}
case CB_GETDROPPEDSTATE: // Determines whether the list box of a combo box is dropped down.
hb_retnint( SendMessage( hCB, CB_GETDROPPEDSTATE, 0, 0 ) );
break;
case CB_GETDROPPEDWIDTH: // Gets the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
hb_retnint( SendMessage( hCB, CB_GETDROPPEDWIDTH, 0, 0 ) );
break;
case CB_GETEDITSEL: // Gets the starting and ending character positions of the current selection in the edit control of a combo box.
{
DWORD range = ( DWORD ) SendMessage( hCB, CB_GETEDITSEL, ( WPARAM ) NULL, ( LPARAM ) NULL );
PHB_ITEM pRng = hb_itemNew( NULL );
hb_arrayNew( pRng, 2 );
hb_arraySetNI( pRng, 1, LOWORD( range ) );
hb_arraySetNI( pRng, 1, HIWORD( range ) );
hb_itemReturnRelease( pRng );
hb_arrayNew( pRng, 2 );
hb_arraySetNI( pRng, 1, LOWORD( range ) );
hb_arraySetNI( pRng, 1, HIWORD( range ) );
hb_itemReturnRelease( pRng );
break;
}
case CB_GETEXTENDEDUI : // Determines whether a combo box has the default user interface or the extended user interface.
hb_retnint( SendMessage( hCB, CB_GETEXTENDEDUI, 0, 0 ) );
break;
case CB_GETHORIZONTALEXTENT : // Gets the width, in pixels, that the list box can be scrolled horizontally (the scrollable width). This is applicable only if the list box has a horizontal scroll bar.
hb_retnint( SendMessage( hCB, CB_GETHORIZONTALEXTENT, 0, 0 ) );
break;
case CB_GETITEMDATA : // An application sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box.
hb_retnint( SendMessage( hCB, CB_GETITEMDATA, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_GETITEMHEIGHT : // Determines the height of list items or the selection field in a combo box.
hb_retnint( SendMessage( hCB, CB_GETITEMHEIGHT, 0, 0 ) );
break;
case CB_GETLBTEXT : // Gets a string from the list of a combo box.
{
HB_ISIZ iSize = SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 );
LPTSTR text = ( LPTSTR ) hb_xgrab( iSize + 1 );
SendMessage( hCB, CB_GETLBTEXT, iSize, ( LPARAM ) text );
HB_RETSTR( text );
hb_xfree( text );
break;
}
case CB_GETLBTEXTLEN : // Gets the length, in characters, of a string in the list of a combo box.
hb_retnint( SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_GETLOCALE : // Gets the current locale of the combo box. The locale is used to determine the correct sorting order of displayed text for combo boxes with the CBS_SORT style and text added by using the CB_ADDSTRING message.
break;
}
case CB_GETEXTENDEDUI: // Determines whether a combo box has the default user interface or the extended user interface.
hb_retnint( SendMessage( hCB, CB_GETEXTENDEDUI, 0, 0 ) );
break;
case CB_GETHORIZONTALEXTENT: // Gets the width, in pixels, that the list box can be scrolled horizontally (the scrollable width). This is applicable only if the list box has a horizontal scroll bar.
hb_retnint( SendMessage( hCB, CB_GETHORIZONTALEXTENT, 0, 0 ) );
break;
case CB_GETITEMDATA: // An application sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box.
hb_retnint( SendMessage( hCB, CB_GETITEMDATA, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_GETITEMHEIGHT: // Determines the height of list items or the selection field in a combo box.
hb_retnint( SendMessage( hCB, CB_GETITEMHEIGHT, 0, 0 ) );
break;
case CB_GETLBTEXT: // Gets a string from the list of a combo box.
{
HB_ISIZ iSize = SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 );
LPTSTR text = ( LPTSTR ) hb_xgrab( iSize + 1 );
SendMessage( hCB, CB_GETLBTEXT, iSize, ( LPARAM ) text );
HB_RETSTR( text );
hb_xfree( text );
break;
}
case CB_GETLBTEXTLEN: // Gets the length, in characters, of a string in the list of a combo box.
hb_retnint( SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_GETLOCALE: // Gets the current locale of the combo box. The locale is used to determine the correct sorting order of displayed text for combo boxes with the CBS_SORT style and text added by using the CB_ADDSTRING message.
#if ( _WIN32_IE >= 0x0600 )
case CB_GETMINVISIBLE : // Gets the minimum number of visible items in the drop-down list of a combo box.
hb_retnint( SendMessage( hCB, CB_GETMINVISIBLE, 0, 0 ) );
break;
case CB_GETMINVISIBLE: // Gets the minimum number of visible items in the drop-down list of a combo box.
hb_retnint( SendMessage( hCB, CB_GETMINVISIBLE, 0, 0 ) );
break;
#endif
case CB_GETTOPINDEX : // An application sends the CB_GETTOPINDEX message to retrieve the zero-based index of the first visible item in the list box portion of a combo box. Initially, the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top.
hb_retnint( SendMessage( hCB, CB_GETTOPINDEX, 0, 0 ) );
break;
case CB_INITSTORAGE : // An application sends the CB_INITSTORAGE message before adding a large number of items to the list box portion of a combo box. This message allocates memory for storing list box items.
break;
case CB_INSERTSTRING : // Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted.
hb_retnint( SendMessage( hCB, CB_INSERTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_LIMITTEXT : // Limits the length of the text the user may type into the edit control of a combo box.
SendMessage( hCB, CB_LIMITTEXT, hb_parni( 3 ), 0 );
break;
case CB_RESETCONTENT : // Removes all items from the list box and edit control of a combo box.
SendMessage( hCB, CB_RESETCONTENT, 0, 0 );
break;
case CB_SELECTSTRING : // Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control.
hb_retnint( SendMessage( hCB, CB_SELECTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_GETTOPINDEX: // An application sends the CB_GETTOPINDEX message to retrieve the zero-based index of the first visible item in the list box portion of a combo box. Initially, the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top.
hb_retnint( SendMessage( hCB, CB_GETTOPINDEX, 0, 0 ) );
break;
case CB_INITSTORAGE: // An application sends the CB_INITSTORAGE message before adding a large number of items to the list box portion of a combo box. This message allocates memory for storing list box items.
break;
case CB_INSERTSTRING: // Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted.
hb_retnint( SendMessage( hCB, CB_INSERTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
case CB_LIMITTEXT: // Limits the length of the text the user may type into the edit control of a combo box.
SendMessage( hCB, CB_LIMITTEXT, hb_parni( 3 ), 0 );
break;
case CB_RESETCONTENT: // Removes all items from the list box and edit control of a combo box.
SendMessage( hCB, CB_RESETCONTENT, 0, 0 );
break;
case CB_SELECTSTRING: // Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control.
hb_retnint( SendMessage( hCB, CB_SELECTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) );
break;
#if defined( CB_SETCUEBANNER )
case CB_SETCUEBANNER : // Sets the cue banner text that is displayed for the edit control of a combo box.
break;
case CB_SETCUEBANNER: // Sets the cue banner text that is displayed for the edit control of a combo box.
break;
#endif
case CB_SETCURSEL : // An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection, and any previous selection in the list is removed.
hb_retnint( SendMessage( hCB, CB_SETCURSEL, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETDROPPEDWIDTH : // An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
hb_retnint( SendMessage( hCB, CB_SETDROPPEDWIDTH, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETEDITSEL : // An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box.
break;
case CB_SETEXTENDEDUI : // An application sends a CB_SETEXTENDEDUI message to select either the default UI or the extended UI for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
SendMessage( hCB, CB_SETEXTENDEDUI, hb_parl( 3 ), 0 );
break;
case CB_SETHORIZONTALEXTENT : // An application sends the CB_SETHORIZONTALEXTENT message to set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width). If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.
SendMessage( hCB, CB_SETHORIZONTALEXTENT, hb_parl( 3 ), 0 );
break;
case CB_SETITEMDATA : // An application sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box.
SendMessage( hCB, CB_SETITEMDATA, hb_parl( 3 ), ( LPARAM ) hb_parnint( 4 ) );
break;
case CB_SETITEMHEIGHT : // An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box.
hb_retnint( SendMessage( hCB, CB_SETITEMHEIGHT, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETLOCALE : // An application sends a CB_SETLOCALE message to set the current locale of the combo box. If the combo box has the CBS_SORT style and strings are added using CB_ADDSTRING, the locale of a combo box affects how list items are sorted.
hb_retnint( SendMessage( hCB, CB_SETLOCALE, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETCURSEL: // An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection, and any previous selection in the list is removed.
hb_retnint( SendMessage( hCB, CB_SETCURSEL, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETDROPPEDWIDTH: // An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
hb_retnint( SendMessage( hCB, CB_SETDROPPEDWIDTH, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETEDITSEL: // An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box.
break;
case CB_SETEXTENDEDUI: // An application sends a CB_SETEXTENDEDUI message to select either the default UI or the extended UI for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
SendMessage( hCB, CB_SETEXTENDEDUI, hb_parl( 3 ), 0 );
break;
case CB_SETHORIZONTALEXTENT: // An application sends the CB_SETHORIZONTALEXTENT message to set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width). If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.
SendMessage( hCB, CB_SETHORIZONTALEXTENT, hb_parl( 3 ), 0 );
break;
case CB_SETITEMDATA: // An application sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box.
SendMessage( hCB, CB_SETITEMDATA, hb_parl( 3 ), ( LPARAM ) hb_parnint( 4 ) );
break;
case CB_SETITEMHEIGHT: // An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box.
hb_retnint( SendMessage( hCB, CB_SETITEMHEIGHT, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETLOCALE: // An application sends a CB_SETLOCALE message to set the current locale of the combo box. If the combo box has the CBS_SORT style and strings are added using CB_ADDSTRING, the locale of a combo box affects how list items are sorted.
hb_retnint( SendMessage( hCB, CB_SETLOCALE, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
#if ( _WIN32_IE >= 0x0600 )
case CB_SETMINVISIBLE : // An application sends a CB_SETMINVISIBLE message to set the minimum number of visible items in the drop-down list of a combo box.
hb_retl( SendMessage( hCB, CB_SETMINVISIBLE, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
case CB_SETMINVISIBLE: // An application sends a CB_SETMINVISIBLE message to set the minimum number of visible items in the drop-down list of a combo box.
hb_retl( SendMessage( hCB, CB_SETMINVISIBLE, ( WPARAM ) hb_parnint( 3 ), 0 ) );
break;
#endif
case CB_SETTOPINDEX : // An application sends the CB_SETTOPINDEX message to ensure that a particular item is visible in the list box of a combo box. The system scrolls the list box contents so that either the specified item appears at the top of the list box or the maximum scroll range has been reached.
hb_retl( SendMessage( hCB, CB_SETTOPINDEX, ( WPARAM ) hb_parnint( 3 ), 0 ) ? FALSE : TRUE );
break;
case CB_SHOWDROPDOWN : // An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
SendMessage( hCB, CB_SHOWDROPDOWN, hb_parl( 3 ), 0 );
break;
case CB_SETTOPINDEX: // An application sends the CB_SETTOPINDEX message to ensure that a particular item is visible in the list box of a combo box. The system scrolls the list box contents so that either the specified item appears at the top of the list box or the maximum scroll range has been reached.
hb_retl( SendMessage( hCB, CB_SETTOPINDEX, ( WPARAM ) hb_parnint( 3 ), 0 ) ? FALSE : TRUE );
break;
case CB_SHOWDROPDOWN: // An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
SendMessage( hCB, CB_SHOWDROPDOWN, hb_parl( 3 ), 0 );
break;
}
if( hText )

View File

@@ -105,9 +105,9 @@
#endif
#if defined( NONAMELESSUNION )
# define HB_WIN_V_UNION( x, z ) ( ( x ).DUMMYUNIONNAME.z )
# define HB_WIN_V_UNION( x, z ) ( ( x ).DUMMYUNIONNAME.z )
#else
# define HB_WIN_V_UNION( x, z ) ( ( x ).z )
# define HB_WIN_V_UNION( x, z ) ( ( x ).z )
#endif
#if ! defined( GCLP_HBRBACKGROUND )
@@ -118,13 +118,13 @@
/*-*/
#define wvg_parwparam( n ) ( ( WPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parlparam( n ) ( ( LPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhandle( n ) ( ( HANDLE ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhwnd( n ) ( ( HWND ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parwndproc( n ) ( ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhbrush( n ) ( ( HBRUSH ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhdc( n ) ( ( HDC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parwparam( n ) ( ( WPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parlparam( n ) ( ( LPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhandle( n ) ( ( HANDLE ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhwnd( n ) ( ( HWND ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parwndproc( n ) ( ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhbrush( n ) ( ( HBRUSH ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parhdc( n ) ( ( HDC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_parcolor( n ) ( ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wvg_rethandle( n ) ( hb_retnint( ( HB_PTRDIFF ) n ) )
@@ -163,11 +163,11 @@ HB_FUNC( WVG_HINSTANCE )
static BITMAPINFO * PackedDibLoad( LPCTSTR szFileName )
{
BITMAPFILEHEADER bmfh;
BITMAPINFO * pbmi;
HB_BOOL bSuccess;
DWORD dwPackedDibSize, dwBytesRead;
HANDLE hFile;
BITMAPFILEHEADER bmfh;
BITMAPINFO * pbmi;
HB_BOOL bSuccess;
DWORD dwPackedDibSize, dwBytesRead;
HANDLE hFile;
hFile = CreateFile( szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL );
@@ -184,11 +184,11 @@ static BITMAPINFO * PackedDibLoad( LPCTSTR szFileName )
return NULL;
}
dwPackedDibSize = bmfh.bfSize - sizeof( BITMAPFILEHEADER );
dwPackedDibSize = bmfh.bfSize - sizeof( BITMAPFILEHEADER );
pbmi = ( BITMAPINFO * ) hb_xgrab( dwPackedDibSize );
pbmi = ( BITMAPINFO * ) hb_xgrab( dwPackedDibSize );
bSuccess = ReadFile( hFile, pbmi, dwPackedDibSize, &dwBytesRead, NULL );
bSuccess = ReadFile( hFile, pbmi, dwPackedDibSize, &dwBytesRead, NULL );
CloseHandle( hFile );
if( ! bSuccess || ( dwBytesRead != dwPackedDibSize ) )
@@ -302,8 +302,8 @@ static HBITMAP hPrepareBitmap( LPCTSTR szBitmap, UINT uiBitmap,
{
int iWidth, iHeight;
{
BITMAPINFO * pPackedDib = NULL;
HDC hdc;
BITMAPINFO * pPackedDib = NULL;
HDC hdc;
if( ! bMap3Dcolors )
pPackedDib = PackedDibLoad( szBitmap );
@@ -353,18 +353,18 @@ static HBITMAP hPrepareBitmap( LPCTSTR szBitmap, UINT uiBitmap,
if( iExpWidth != iWidth || iExpHeight != iHeight )
{
HDC hdcSource, hdcTarget;
HBITMAP hBitmap2;
HB_BOOL bResult;
HDC hdcSource, hdcTarget;
HBITMAP hBitmap2;
HB_BOOL bResult;
hdcSource = CreateCompatibleDC( hdc );
hdcSource = CreateCompatibleDC( hdc );
SelectObject( hdcSource, hBitmap );
hdcTarget = CreateCompatibleDC( hdc );
hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight );
hdcTarget = CreateCompatibleDC( hdc );
hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight );
SelectObject( hdcTarget, hBitmap2 );
bResult = StretchBlt(
bResult = StretchBlt(
hdcTarget, /* handle to destination DC */
0, /* x-coord of destination upper-left corner */
0, /* y-coord of destination upper-left corner */
@@ -417,8 +417,8 @@ static HBITMAP hPrepareBitmap( LPCTSTR szBitmap, UINT uiBitmap,
break;
case 2: /* loading from resourceid */
{
UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR;
char szResname[ MAX_PATH + 1 ];
UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR;
char szResname[ MAX_PATH + 1 ];
hb_snprintf( szResname, sizeof( szResname ), "?%u", uiBitmap );
@@ -443,7 +443,7 @@ static HBITMAP hPrepareBitmap( LPCTSTR szBitmap, UINT uiBitmap,
HB_FUNC( WVG_PREPAREBITMAPFROMFILE )
{
HBITMAP hBitmap;
void * hText;
void * hText;
hBitmap = hPrepareBitmap( HB_PARSTR( 1, &hText, NULL ), 0, hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ),
( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ), 0 );
@@ -468,7 +468,7 @@ HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCEID )
HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCENAME )
{
HBITMAP hBitmap;
void * hText;
void * hText;
hBitmap = hPrepareBitmap( HB_PARSTR( 1, &hText, NULL ), 0, hb_parni( 2 ), hb_parni( 3 ), hb_parl( 4 ),
( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ), 1 );
@@ -479,8 +479,8 @@ HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCENAME )
HB_FUNC( WVG_STATUSBARCREATEPANEL )
{
HWND hWndSB = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
int iMode = hb_parni( 2 );
HWND hWndSB = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 );
int iMode = hb_parni( 2 );
if( hWndSB == NULL || ! IsWindow( hWndSB ) )
{
@@ -492,16 +492,16 @@ HB_FUNC( WVG_STATUSBARCREATEPANEL )
{
case 0:
{
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
int iParts;
RECT rc = { 0, 0, 0, 0 };
int n;
int width;
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
int iParts;
RECT rc = { 0, 0, 0, 0 };
int n;
int width;
iParts = ( int ) SendMessage( hWndSB, SB_GETPARTS, ( WPARAM ) WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray );
iParts = ( int ) SendMessage( hWndSB, SB_GETPARTS, ( WPARAM ) WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray );
GetClientRect( hWndSB, &rc );
width = ( int ) ( rc.right / ( iParts + 1 ) );
width = ( int ) ( rc.right / ( iParts + 1 ) );
for( n = 0; n < iParts; n++ )
ptArray[ n ] = ( width * ( n + 1 ) );
@@ -515,8 +515,8 @@ HB_FUNC( WVG_STATUSBARCREATEPANEL )
}
case -1:
{
RECT rc = { 0, 0, 0, 0 };
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
RECT rc = { 0, 0, 0, 0 };
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
if( GetClientRect( hWndSB, &rc ) )
{
@@ -541,14 +541,14 @@ HB_FUNC( WVG_STATUSBARSETTEXT )
if( hWndSB && IsWindow( hWndSB ) )
{
int iPart = hb_parnidef( 2, 1 );
TCHAR szText[ 1024 ];
int iFlags;
void * hCaption;
int iPart = hb_parnidef( 2, 1 );
TCHAR szText[ 1024 ];
int iFlags;
void * hCaption;
iPart -= 1; /* Zero based */
iPart -= 1; /* Zero based */
iFlags = ( int ) HIWORD( SendMessage( hWndSB, SB_GETTEXT, ( WPARAM ) iPart, ( LPARAM ) szText ) );
iFlags = ( int ) HIWORD( SendMessage( hWndSB, SB_GETTEXT, ( WPARAM ) iPart, ( LPARAM ) szText ) );
SendMessage( hWndSB, SB_SETTEXT, ( WPARAM ) iPart | iFlags, ( LPARAM ) HB_PARSTR( 3, &hCaption, NULL ) );
@@ -565,12 +565,12 @@ HB_FUNC( WVG_STATUSBARREFRESH )
if( hWndSB && IsWindow( hWndSB ) )
{
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
int iParts, i;
int ptArray[ WIN_STATUSBAR_MAX_PARTS ];
int iParts, i;
iParts = SendMessage( hWndSB, SB_GETPARTS, WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray );
iParts = SendMessage( hWndSB, SB_GETPARTS, WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray );
ptArray[ iParts - 1 ] = -1;
ptArray[ iParts - 1 ] = -1;
if( SendMessage( hWndSB, SB_SETPARTS, iParts, ( LPARAM ) ( LPINT ) ptArray ) )
{
@@ -588,8 +588,8 @@ HB_FUNC( WVG_STATUSBARREFRESH )
*/
HB_FUNC( WVG_GETNMHDRINFO )
{
LPNMHDR lpnmh = ( LPNMHDR ) wvg_parlparam( 1 );
PHB_ITEM pEvParams = hb_itemNew( NULL );
LPNMHDR lpnmh = ( LPNMHDR ) wvg_parlparam( 1 );
PHB_ITEM pEvParams = hb_itemNew( NULL );
hb_arrayNew( pEvParams, 3 );
@@ -605,9 +605,9 @@ HB_FUNC( WVG_GETNMHDRINFO )
*/
HB_FUNC( WVG_GETNMMOUSEINFO )
{
LPNMMOUSE nmm = ( LPNMMOUSE ) wvg_parlparam( 1 );
NMHDR nmh = nmm->hdr;
PHB_ITEM pEvParams = hb_itemNew( NULL );
LPNMMOUSE nmm = ( LPNMMOUSE ) wvg_parlparam( 1 );
NMHDR nmh = nmm->hdr;
PHB_ITEM pEvParams = hb_itemNew( NULL );
hb_arrayNew( pEvParams, 4 );
@@ -624,10 +624,10 @@ HB_FUNC( WVG_GETNMMOUSEINFO )
*/
HB_FUNC( WVG_GETNMTREEVIEWINFO )
{
LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 1 );
NMHDR nmh = pnmtv->hdr;
LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 1 );
NMHDR nmh = pnmtv->hdr;
PHB_ITEM pEvParams = hb_itemNew( NULL );
PHB_ITEM pEvParams = hb_itemNew( NULL );
hb_arrayNew( pEvParams, 4 );
@@ -644,33 +644,33 @@ HB_FUNC( WVG_GETNMTREEVIEWINFO )
*/
HB_FUNC( WVG_TREEVIEW_GETSELECTIONINFO )
{
LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 2 );
HTREEITEM hSelected = pnmtv->itemNew.hItem;
LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 2 );
HTREEITEM hSelected = pnmtv->itemNew.hItem;
if( hSelected != NULL )
{
TCHAR text[ MAX_PATH + 1 ];
TCHAR Parent[ MAX_PATH + 1 ];
TV_ITEM item;
HTREEITEM hParent;
TCHAR text[ MAX_PATH + 1 ];
TCHAR Parent[ MAX_PATH + 1 ];
TV_ITEM item;
HTREEITEM hParent;
hb_stornint( ( HB_PTRDIFF ) hSelected, 6 );
item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_IMAGE;
item.hItem = hSelected;
item.pszText = text;
item.cchTextMax = MAX_PATH;
item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_IMAGE;
item.hItem = hSelected;
item.pszText = text;
item.cchTextMax = MAX_PATH;
if( TreeView_GetItem( wvg_parhwnd( 1 ), &item ) )
HB_STORSTR( text, 4 );
hParent = TreeView_GetParent( wvg_parhwnd( 1 ), hSelected );
hParent = TreeView_GetParent( wvg_parhwnd( 1 ), hSelected );
hb_stornint( ( HB_PTRDIFF ) hParent, 5 );
item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = hParent;
item.pszText = Parent;
item.cchTextMax = MAX_PATH;
item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = hParent;
item.pszText = Parent;
item.cchTextMax = MAX_PATH;
if( TreeView_GetItem( wvg_parhwnd( 1 ), &item ) )
HB_STORSTR( Parent, 3 );
@@ -686,16 +686,16 @@ HB_FUNC( WVG_TREEVIEW_ADDITEM )
TVINSERTSTRUCT tvis;
void * hText;
tvis.hInsertAfter = TVI_LAST;
HB_WIN_V_UNION( tvis, item.mask ) = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
HB_WIN_V_UNION( tvis, item.cchTextMax ) = MAX_PATH + 1;
HB_WIN_V_UNION( tvis, item.stateMask ) = TVIS_BOLD | TVIS_CUT | TVIS_DROPHILITED |
TVIS_EXPANDEDONCE | TVIS_SELECTED | TVIS_EXPANDPARTIAL |
TVIS_OVERLAYMASK | TVIS_STATEIMAGEMASK | TVIS_USERMASK;
tvis.hInsertAfter = TVI_LAST;
HB_WIN_V_UNION( tvis, item.mask ) = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
HB_WIN_V_UNION( tvis, item.cchTextMax ) = MAX_PATH + 1;
HB_WIN_V_UNION( tvis, item.stateMask ) = TVIS_BOLD | TVIS_CUT | TVIS_DROPHILITED |
TVIS_EXPANDEDONCE | TVIS_SELECTED | TVIS_EXPANDPARTIAL |
TVIS_OVERLAYMASK | TVIS_STATEIMAGEMASK | TVIS_USERMASK;
HB_WIN_V_UNION( tvis, item.state ) = 0; /* TVI_BOLD */
tvis.hParent = HB_ISNUM( 2 ) ? ( HTREEITEM ) wvg_parhandle( 2 ) : NULL;
HB_WIN_V_UNION( tvis, item.pszText ) = ( LPTSTR ) HB_PARSTRDEF( 3, &hText, NULL );
HB_WIN_V_UNION( tvis, item.state ) = 0; /* TVI_BOLD */
tvis.hParent = HB_ISNUM( 2 ) ? ( HTREEITEM ) wvg_parhandle( 2 ) : NULL;
HB_WIN_V_UNION( tvis, item.pszText ) = ( LPTSTR ) HB_PARSTRDEF( 3, &hText, NULL );
hb_retnint( ( HB_PTRDIFF ) TreeView_InsertItem( wvg_parhwnd( 1 ), &tvis ) );
@@ -706,10 +706,10 @@ HB_FUNC( WVG_TREEVIEW_ADDITEM )
HB_FUNC( WVG_TREEVIEW_SHOWEXPANDED )
{
HWND hwnd = wvg_parhwnd( 1 );
HTREEITEM hroot, hitem, hitem1, hitem2, hitem3;
int iExpand = ( hb_parl( 2 ) ? TVE_EXPAND : TVE_COLLAPSE );
int iLevels = hb_parni( 3 ) <= 0 ? 5 : hb_parni( 3 );
HWND hwnd = wvg_parhwnd( 1 );
HTREEITEM hroot, hitem, hitem1, hitem2, hitem3;
int iExpand = ( hb_parl( 2 ) ? TVE_EXPAND : TVE_COLLAPSE );
int iLevels = hb_parni( 3 ) <= 0 ? 5 : hb_parni( 3 );
hroot = TreeView_GetRoot( hwnd );
if( hroot )
@@ -809,14 +809,14 @@ PHB_ITEM wvg_logfontTOarray( LPLOGFONT lf, HB_BOOL bEmpty )
BOOL CALLBACK WvgDialogProcChooseFont( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
HB_BOOL bret = HB_FALSE;
HB_BOOL binit = HB_FALSE;
HB_BOOL bret = HB_FALSE;
HB_BOOL binit = HB_FALSE;
PHB_ITEM block;
if( msg == WM_INITDIALOG )
{
CHOOSEFONT * cf = ( CHOOSEFONT * ) lParam;
PHB_ITEM pBlock = ( PHB_ITEM ) hb_itemNew( ( PHB_ITEM ) cf->lCustData );
CHOOSEFONT * cf = ( CHOOSEFONT * ) lParam;
PHB_ITEM pBlock = ( PHB_ITEM ) hb_itemNew( ( PHB_ITEM ) cf->lCustData );
SetProp( hwnd, TEXT( "DIALOGPROC" ), pBlock );
binit = HB_TRUE;
}
@@ -854,12 +854,12 @@ BOOL CALLBACK WvgDialogProcChooseFont( HWND hwnd, UINT msg, WPARAM wParam, LPARA
HB_FUNC( WVG_CHOOSEFONT )
{
#if ! defined( HB_OS_WIN_CE )
CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
DWORD Flags;
LONG PointSize = 0;
HWND hWnd = wvg_parhwnd( 1 );
TCHAR szStyle[ MAX_PATH + 1 ];
CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */
DWORD Flags;
LONG PointSize = 0;
HWND hWnd = wvg_parhwnd( 1 );
TCHAR szStyle[ MAX_PATH + 1 ];
if( HB_ISCHAR( 3 ) )
{
@@ -883,15 +883,15 @@ HB_FUNC( WVG_CHOOSEFONT )
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = FF_DONTCARE;
Flags = CF_EFFECTS | CF_SHOWHELP | CF_APPLY | CF_INITTOLOGFONTSTRUCT | CF_ENABLEHOOK;
Flags = CF_EFFECTS | CF_SHOWHELP | CF_APPLY | CF_INITTOLOGFONTSTRUCT | CF_ENABLEHOOK;
#if 0
Flags |= CF_TTONLY;
Flags |= CF_FIXEDPITCHONLY;
Flags |= CF_SCALABLEONLY;
Flags |= CF_NOVECTORFONTS;
Flags |= CF_NOSCRIPTSEL;
Flags |= CF_NOSIMULATIONS; /* ::synthesizeFonts == .f. */
Flags |= CF_TTONLY;
Flags |= CF_FIXEDPITCHONLY;
Flags |= CF_SCALABLEONLY;
Flags |= CF_NOVECTORFONTS;
Flags |= CF_NOSCRIPTSEL;
Flags |= CF_NOSIMULATIONS; /* ::synthesizeFonts == .f. */
#endif
if( hb_parl( 5 ) )
@@ -899,28 +899,28 @@ HB_FUNC( WVG_CHOOSEFONT )
if( hb_parl( 6 ) )
Flags = Flags | CF_PRINTERFONTS;
cf.lStructSize = sizeof( CHOOSEFONT );
cf.hwndOwner = hWnd;
cf.hDC = ( HDC ) NULL; /* only when ::oPrinterPS is defined */
cf.lpLogFont = &lf;
cf.iPointSize = PointSize;
cf.Flags = Flags;
cf.rgbColors = RGB( 0, 0, 0 );
cf.lStructSize = sizeof( CHOOSEFONT );
cf.hwndOwner = hWnd;
cf.hDC = ( HDC ) NULL; /* only when ::oPrinterPS is defined */
cf.lpLogFont = &lf;
cf.iPointSize = PointSize;
cf.Flags = Flags;
cf.rgbColors = RGB( 0, 0, 0 );
cf.lCustData = ( HB_PTRDIFF ) hb_param( 2, HB_IT_BLOCK );
cf.lpfnHook = ( LPCFHOOKPROC ) WvgDialogProcChooseFont;
cf.lCustData = ( HB_PTRDIFF ) hb_param( 2, HB_IT_BLOCK );
cf.lpfnHook = ( LPCFHOOKPROC ) WvgDialogProcChooseFont;
cf.lpTemplateName = ( LPTSTR ) NULL;
cf.hInstance = ( HINSTANCE ) NULL;
cf.lpszStyle = ( LPTSTR ) szStyle;
cf.nFontType = SCREEN_FONTTYPE; /* ?? */
cf.nSizeMin = 0;
cf.nSizeMax = 0;
cf.lpTemplateName = ( LPTSTR ) NULL;
cf.hInstance = ( HINSTANCE ) NULL;
cf.lpszStyle = ( LPTSTR ) szStyle;
cf.nFontType = SCREEN_FONTTYPE; /* ?? */
cf.nSizeMin = 0;
cf.nSizeMax = 0;
if( ChooseFont( &cf ) )
{
PHB_ITEM aFont = wvg_logfontTOarray( &lf, HB_FALSE );
PHB_ITEM aInfo = hb_itemNew( NULL );
PHB_ITEM aFont = wvg_logfontTOarray( &lf, HB_FALSE );
PHB_ITEM aInfo = hb_itemNew( NULL );
hb_arrayNew( aInfo, 4 );
hb_arraySetNI( aInfo, 1, cf.iPointSize );
@@ -972,9 +972,9 @@ HB_FUNC( WVG_FONTCREATE )
lf.lfHeight = ( LONG ) hb_arrayGetNL( aFont, 2 );
lf.lfWidth = ( LONG ) hb_arrayGetNL( aFont, 3 );
lf.lfWeight = ( LONG ) hb_arrayGetNL( aFont, 4 );
lf.lfItalic = ( BYTE ) hb_arrayGetL ( aFont, 5 );
lf.lfUnderline = ( BYTE ) hb_arrayGetL ( aFont, 6 );
lf.lfStrikeOut = ( BYTE ) hb_arrayGetL ( aFont, 7 );
lf.lfItalic = ( BYTE ) hb_arrayGetL( aFont, 5 );
lf.lfUnderline = ( BYTE ) hb_arrayGetL( aFont, 6 );
lf.lfStrikeOut = ( BYTE ) hb_arrayGetL( aFont, 7 );
lf.lfCharSet = ( BYTE ) hb_arrayGetNI( aFont, 8 );
lf.lfEscapement = ( BYTE ) hb_arrayGetNI( aFont, 9 );
lf.lfOrientation = ( BYTE ) hb_arrayGetNI( aFont, 10 );
@@ -984,7 +984,7 @@ HB_FUNC( WVG_FONTCREATE )
lf.lfPitchAndFamily = ( BYTE ) hb_arrayGetNI( aFont, 14 );
}
hFont = CreateFontIndirect( &lf );
hFont = CreateFontIndirect( &lf );
if( hFont )
{
@@ -1044,10 +1044,10 @@ HB_FUNC( WVG_SETCURRENTBRUSH )
*/
HB_FUNC( WVG_ADDTOOLBARBUTTON )
{
TBBUTTON tbb;
HB_BOOL bSuccess;
HWND hWndTB = hbwapi_par_raw_HWND( 1 );
int iCommand = hb_parni( 4 );
TBBUTTON tbb;
HB_BOOL bSuccess;
HWND hWndTB = hbwapi_par_raw_HWND( 1 );
int iCommand = hb_parni( 4 );
switch( hb_parni( 5 ) )
{
@@ -1074,7 +1074,7 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON )
tbb.iString = iNewString;
/* TOFIX: Convertion of LRESULT to HB_BOOL */
bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb );
bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb );
#if ! defined( HB_OS_WIN_CE )
SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10, 10 ) );
#endif
@@ -1094,7 +1094,7 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON )
tbb.iString = 0;
/* TOFIX: Convertion of LRESULT to HB_BOOL */
bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb );
bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb );
hb_retl( bSuccess );
return;
}
@@ -1107,7 +1107,7 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON )
HB_FUNC( WVG_REGISTERCLASS_BYNAME )
{
WNDCLASS wndclass;
void * hClass;
void * hClass;
memset( &wndclass, 0, sizeof( WNDCLASS ) );
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
@@ -1134,10 +1134,10 @@ HB_FUNC( WVG_FILLRECT )
{
RECT rc;
rc.left = hb_parvni( 2, 1 );
rc.top = hb_parvni( 2, 2 );
rc.right = hb_parvni( 2, 3 );
rc.bottom = hb_parvni( 2, 4 );
rc.left = hb_parvni( 2, 1 );
rc.top = hb_parvni( 2, 2 );
rc.right = hb_parvni( 2, 3 );
rc.bottom = hb_parvni( 2, 4 );
FillRect( wvg_parhdc( 1 ), &rc, wvg_parhbrush( 3 ) );
}
@@ -1149,10 +1149,10 @@ HB_FUNC( WVG_BEGINMOUSETRACKING )
#if ! defined( HB_OS_WIN_CE )
TRACKMOUSEEVENT tmi;
tmi.cbSize = sizeof( TRACKMOUSEEVENT );
tmi.dwFlags = TME_LEAVE | TME_HOVER;
tmi.hwndTrack = hbwapi_par_raw_HWND( 1 );
tmi.dwHoverTime = 1;
tmi.cbSize = sizeof( TRACKMOUSEEVENT );
tmi.dwFlags = TME_LEAVE | TME_HOVER;
tmi.hwndTrack = hbwapi_par_raw_HWND( 1 );
tmi.dwHoverTime = 1;
hbwapi_ret_L( _TrackMouseEvent( &tmi ) );
#else
hbwapi_ret_L( FALSE );
@@ -1194,8 +1194,8 @@ LRESULT CALLBACK ControlWindowProcedure( HWND hwnd, UINT msg, WPARAM wParam, LPA
HB_FUNC( WVG_SETWINDOWPROCBLOCK )
{
WNDPROC oldProc;
HWND hWnd = hbwapi_par_raw_HWND( 1 );
PHB_ITEM pBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) );
HWND hWnd = hbwapi_par_raw_HWND( 1 );
PHB_ITEM pBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) );
SetProp( hWnd, TEXT( "BLOCKCALLBACK" ), pBlock );
@@ -1212,8 +1212,8 @@ HB_FUNC( WVG_SETWINDOWPROCBLOCK )
HB_FUNC( WVG_RELEASEWINDOWPROCBLOCK )
{
HWND hWnd = hbwapi_par_raw_HWND( 1 );
PHB_ITEM pBlock = ( PHB_ITEM ) RemoveProp( hWnd, TEXT( "BLOCKCALLBACK" ) );
HWND hWnd = hbwapi_par_raw_HWND( 1 );
PHB_ITEM pBlock = ( PHB_ITEM ) RemoveProp( hWnd, TEXT( "BLOCKCALLBACK" ) );
if( pBlock )
hb_itemRelease( pBlock );
@@ -1222,7 +1222,7 @@ HB_FUNC( WVG_RELEASEWINDOWPROCBLOCK )
/*-*/
/*
WVG_CreateTooltipWindow( hControl ) -> hWndTT
*/
*/
HB_FUNC( WVG_CREATETOOLTIPWINDOW )
{
HWND hwndTip;
@@ -1257,7 +1257,7 @@ HB_FUNC( WVG_CREATETOOLTIPWINDOW )
HB_FUNC( WVG_SETTOOLTIPTEXT )
{
TOOLINFO toolInfo;
void * hText;
void * hText;
memset( &toolInfo, 0, sizeof( toolInfo ) );
toolInfo.cbSize = sizeof( toolInfo );

View File

@@ -139,8 +139,10 @@ CREATE CLASS HBFORMATCODE
METHOD ConvertCmd( cLine, nBegin, nEnd, lFirstOnly )
METHOD ConvertFnc( cLine, nBegin, nEnd )
METHOD ConvertBool( cLine, nBegin, nEnd )
METHOD Source2Array( cSource )
METHOD Array2Source( aSource )
METHOD File2Array( cFileName )
METHOD Array2File( cFileName, aFile )
METHOD Array2File( cFileName, aSource )
ENDCLASS
@@ -807,27 +809,49 @@ METHOD ReadIni( cIniName ) CLASS HBFORMATCODE
RETURN ::nErr == 0
METHOD File2Array( cFileName ) CLASS HBFORMATCODE
METHOD Source2Array( cSource ) CLASS HBFORMATCODE
LOCAL aFile
IF hb_FileExists( cFileName )
aFile := hb_ATokens( StrTran( MemoRead( cFileName ), Chr( 13 ) + Chr( 10 ), Chr( 10 ) ), Chr( 10 ) )
IF ::nEol < 0
IF Chr( 13 ) + Chr( 10 ) $ MemoRead( cFileName )
::cEol := Chr( 13 ) + Chr( 10 )
ELSE
::cEol := Chr( 10 )
ENDIF
IF ::nEol < 0
IF Chr( 13 ) + Chr( 10 ) $ cSource
::cEol := Chr( 13 ) + Chr( 10 )
ELSE
::cEol := Chr( 10 )
ENDIF
ENDIF
RETURN aFile
RETURN hb_ATokens( StrTran( cSource, Chr( 13 ) + Chr( 10 ), Chr( 10 ) ), Chr( 10 ) )
METHOD Array2File( cFileName, aFile ) CLASS HBFORMATCODE
METHOD Array2Source( aSource ) CLASS HBFORMATCODE
LOCAL i, nLen := Len( aFile ), cName, cBakName, cPath
LOCAL cFile
LOCAL nLen := Len( aSource ), i
LOCAL cSource := ""
FOR i := 1 TO nLen
IF aSource[ i ] == NIL
EXIT
ENDIF
IF i < nLen .OR. ! Empty( aSource[ i ] )
cSource += aSource[ i ] + ::cEol
ENDIF
NEXT
DO WHILE Right( cSource, Len( ::cEol ) * 2 ) == Replicate( ::cEol, 2 )
cSource := hb_StrShrink( cSource, Len( ::cEol ) )
ENDDO
RETURN cSource
METHOD File2Array( cFileName ) CLASS HBFORMATCODE
IF hb_FileExists( cFileName )
RETURN ::String2Array( MemoRead( cFileName ) )
ENDIF
RETURN NIL
METHOD Array2File( cFileName, aSource ) CLASS HBFORMATCODE
LOCAL i, cName, cBakName, cPath
cName := iif( ( i := RAt( ".", cFileName ) ) == 0, cFileName, SubStr( cFileName, 1, i - 1 ) )
IF Empty( ::cExtSave )
@@ -847,21 +871,7 @@ METHOD Array2File( cFileName, aFile ) CLASS HBFORMATCODE
cFileName := cPath + Lower( iif( i == 0, cFileName, SubStr( cFileName, i + 1 ) ) )
ENDIF
cFile := ""
FOR i := 1 TO nLen
IF aFile[ i ] == NIL
EXIT
ENDIF
IF i < nLen .OR. ! Empty( aFile[ i ] )
cFile += aFile[ i ] + ::cEol
ENDIF
NEXT
DO WHILE Right( cFile, Len( ::cEol ) * 2 ) == Replicate( ::cEol, 2 )
cFile := hb_StrShrink( cFile, Len( ::cEol ) )
ENDDO
RETURN hb_MemoWrit( cFileName, cFile )
RETURN hb_MemoWrit( cFileName, ::Array2String( aSource ) )
STATIC FUNCTION rf_AINS( arr, nItem, cItem )

View File

@@ -50,6 +50,8 @@
*
*/
#require "hbformat"
#include "directry.ch"
ANNOUNCE HB_GTSYS

View File

@@ -7,9 +7,9 @@
#include "hbsocket.ch"
#include "hbthread.ch"
#ifdef HB_HAS_OPENSSL
#include "hbssl.ch"
#endif
#undef __HBEXTREQ__
#include "hbssl.hbx"
#pragma -km+
@@ -35,7 +35,7 @@ MEMVAR server, get, post, cookie, session, httpd
CREATE CLASS UHttpd MODULE FRIENDLY
EXPORTED:
METHOD RUN( hConfig )
METHOD Run( hConfig )
METHOD Stop()
VAR cError INIT ""
@@ -55,6 +55,8 @@ CREATE CLASS UHttpd MODULE FRIENDLY
VAR lStop
VAR lHasSSL INIT hb_IsFunction( "__HBEXTERN__HBSSL__" )
METHOD LogAccess()
METHOD LogError( cError )
@@ -64,7 +66,7 @@ FUNCTION UHttpdNew()
RETURN UHttpd()
METHOD RUN( hConfig ) CLASS UHttpd
METHOD Run( hConfig ) CLASS UHttpd
LOCAL hSocket, nI, aI, xValue, aThreads, nJobs, nWorkers
@@ -96,26 +98,26 @@ METHOD RUN( hConfig ) CLASS UHttpd
IF Self:hConfig[ "SSL" ]
#ifdef HB_HAS_OPENSSL
SSL_INIT()
DO WHILE RAND_STATUS() != 1
RAND_add( Str( hb_Random(), 18, 15 ) + Str( hb_milliSeconds(), 20 ), 1 )
ENDDO
IF Self:lHasSSL
SSL_INIT()
DO WHILE RAND_STATUS() != 1
RAND_add( Str( hb_Random(), 18, 15 ) + Str( hb_milliSeconds(), 20 ), 1 )
ENDDO
Self:hSSLCtx := SSL_CTX_NEW( HB_SSL_CTX_NEW_METHOD_SSLV23_SERVER )
SSL_CTX_SET_OPTIONS( Self:hSSLCtx, HB_SSL_OP_NO_TLSv1 )
IF SSL_CTX_USE_PRIVATEKEY_FILE( Self:hSSLCtx, Self:hConfig[ "PrivateKeyFilename" ], HB_SSL_FILETYPE_PEM ) != 1
Self:cError := "Invalid private key file"
Self:hSSLCtx := SSL_CTX_NEW( HB_SSL_CTX_NEW_METHOD_SSLV23_SERVER )
SSL_CTX_SET_OPTIONS( Self:hSSLCtx, HB_SSL_OP_NO_TLSv1 )
IF SSL_CTX_USE_PRIVATEKEY_FILE( Self:hSSLCtx, Self:hConfig[ "PrivateKeyFilename" ], HB_SSL_FILETYPE_PEM ) != 1
Self:cError := "Invalid private key file"
RETURN .F.
ENDIF
IF SSL_CTX_USE_CERTIFICATE_FILE( Self:hSSLCtx, Self:hConfig[ "CertificateFilename" ], HB_SSL_FILETYPE_PEM ) != 1
Self:cError := "Invalid certificate file"
RETURN .F.
ENDIF
ELSE
Self:cError := "SSL not supported"
RETURN .F.
ENDIF
IF SSL_CTX_USE_CERTIFICATE_FILE( Self:hSSLCtx, Self:hConfig[ "CertificateFilename" ], HB_SSL_FILETYPE_PEM ) != 1
Self:cError := "Invalid certificate file"
RETURN .F.
ENDIF
#else
Self:cError := "SSL not supported"
RETURN .F.
#endif
ENDIF
IF Self:hConfig[ "Port" ] < 1 .OR. Self:hConfig[ "Port" ] > 65535
@@ -324,8 +326,6 @@ STATIC FUNCTION ParseFirewallFilter( cFilter, aFilter )
RETURN .T.
#ifdef HB_HAS_OPENSSL
STATIC FUNCTION MY_SSL_READ( hConfig, hSSL, hSocket, cBuf, nTimeout, nError )
LOCAL nErr, nLen
@@ -425,14 +425,10 @@ STATIC FUNCTION MY_SSL_ACCEPT( hConfig, hSSL, hSocket, nTimeout )
RETURN nErr
#endif
STATIC FUNCTION ProcessConnection( oServer )
LOCAL hSocket, cRequest, aI, nLen, nErr, nTime, nReqLen, cBuf, aServer
#ifdef HB_HAS_OPENSSL
LOCAL hSSL
#endif
ErrorBlock( {| o | UErrorHandler( o, oServer ) } )
@@ -471,8 +467,7 @@ STATIC FUNCTION ProcessConnection( oServer )
LOOP
ENDIF
#ifdef HB_HAS_OPENSSL
IF oServer:hConfig[ "SSL" ]
IF oServer:lHasSSL .AND. oServer:hConfig[ "SSL" ]
hSSL := SSL_NEW( oServer:hSSLCtx )
SSL_SET_MODE( hSSL, hb_bitOr( SSL_GET_MODE( hSSL ), HB_SSL_MODE_ENABLE_PARTIAL_WRITE ) )
hb_socketSetBlockingIO( hSocket, .F. )
@@ -510,7 +505,6 @@ STATIC FUNCTION ProcessConnection( oServer )
aServer[ "SSL_SERVER_I_DN" ] := X509_NAME_ONELINE( X509_GET_ISSUER_NAME( SSL_GET_CERTIFICATE( hSSL ) ) )
aServer[ "SSL_SERVER_S_DN" ] := X509_NAME_ONELINE( X509_GET_SUBJECT_NAME( SSL_GET_CERTIFICATE( hSSL ) ) )
ENDIF
#endif
/* loop for processing connection */
@@ -523,18 +517,15 @@ STATIC FUNCTION ProcessConnection( oServer )
nTime := hb_Milliseconds()
cBuf := Space( 4096 )
DO WHILE At( CR_LF + CR_LF, cRequest ) == 0
#ifdef HB_HAS_OPENSSL
IF oServer:hConfig[ "SSL" ]
IF oServer:lHasSSL .AND. oServer:hConfig[ "SSL" ]
nLen := MY_SSL_READ( oServer:hConfig, hSSL, hSocket, @cBuf, 1000, @nErr )
ELSE
#endif
nLen := hb_socketRecv( hSocket, @cBuf,,, 1000 )
IF nLen < 0
nErr := hb_socketGetError()
ENDIF
#ifdef HB_HAS_OPENSSL
ENDIF
#endif
IF nLen > 0
cRequest += hb_BLeft( cBuf, nLen )
ELSEIF nLen == 0
@@ -583,18 +574,15 @@ STATIC FUNCTION ProcessConnection( oServer )
nTime := hb_Milliseconds()
cBuf := Space( 4096 )
DO WHILE Len( cRequest ) < nReqLen
#ifdef HB_HAS_OPENSSL
IF oServer:hConfig[ "SSL" ]
IF oServer:lHasSSL .AND. oServer:hConfig[ "SSL" ]
nLen := MY_SSL_READ( oServer:hConfig, hSSL, hSocket, @cBuf, 1000, @nErr )
ELSE
#endif
nLen := hb_socketRecv( hSocket, @cBuf,,, 1000 )
IF nLen < 0
nErr := hb_socketGetError()
ENDIF
#ifdef HB_HAS_OPENSSL
ENDIF
#endif
IF nLen > 0
cRequest += hb_BLeft( cBuf, nLen )
ELSEIF nLen == 0
@@ -649,18 +637,15 @@ STATIC FUNCTION ProcessConnection( oServer )
cBuf := MakeResponse( oServer:hConfig )
DO WHILE hb_BLen( cBuf ) > 0 .AND. ! oServer:lStop
#ifdef HB_HAS_OPENSSL
IF oServer:hConfig[ "SSL" ]
IF oServer:lHasSSL .AND. oServer:hConfig[ "SSL" ]
nLen := MY_SSL_WRITE( oServer:hConfig, hSSL, hSocket, cBuf, 1000, @nErr )
ELSE
#endif
nLen := hb_socketSend( hSocket, cBuf,,, 1000 )
IF nLen < 0
nErr := hb_socketGetError()
ENDIF
#ifdef HB_HAS_OPENSSL
ENDIF
#endif
IF nLen < 0
Eval( oServer:hConfig[ "Trace" ], "send error:", nErr, hb_socketErrorString( nErr ) )
EXIT
@@ -680,9 +665,10 @@ STATIC FUNCTION ProcessConnection( oServer )
ENDIF
ENDDO
#ifdef HB_HAS_OPENSSL
hSSL := NIL
#endif
IF oServer:lHasSSL
hSSL := NIL
ENDIF
Eval( oServer:hConfig[ "Trace" ], "Close connection1", hSocket )
hb_socketShutdown( hSocket )
hb_socketClose( hSocket )
@@ -1648,7 +1634,7 @@ STATIC FUNCTION compile_file( cFileName, hConfig )
IF cFileName == NIL
cFileName := MEMVAR->server[ "SCRIPT_NAME" ]
ENDIF
cFileName := UOsFileName( hb_DirBase() + "/tpl/" + cFileName + ".tpl" )
cFileName := UOsFileName( hb_DirBase() + "tpl/" + cFileName + ".tpl" )
IF hb_FileExists( cFileName )
cTpl := hb_MemoRead( cFileName )
BEGIN SEQUENCE

View File

@@ -2,15 +2,10 @@
# $Id$
#
# Set HB_HTTPD_OPENSSL envvar to 'yes' or use -env:HB_HTTPD_OPENSSL=yes
# hbmk2 option to switch to the SSL-enabled version of this library.
description=HTTP server
incpaths=.
{!HB_HTTPD_OPENSSL|dos}libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{HB_HTTPD_OPENSSL&!dos}libs=${_HB_DYNPREF}${hb_name}s${_HB_DYNSUFF}
{HB_HTTPD_OPENSSL&!dos}libs=hbssl.hbc
libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
mt=yes

View File

@@ -15,4 +15,6 @@ core.prg
widgets.prg
log.prg
-env:HB_DYNBIND_OPENSSL=yes
hbssl.hbc

View File

@@ -1,11 +0,0 @@
#
# $Id$
#
-hbx=
@hbhttpd.hbp
hbssl.hbc
-DHB_HAS_OPENSSL

View File

@@ -9,6 +9,11 @@ openssl x509 -req -days 730 -in certrequest.csr -signkey privatekey.pem -out cer
openssl x509 -in certificate.pem -text -noout
*/
#require "hbssl"
#require "hbhttpd"
REQUEST __HBEXTERN__HBSSL__
REQUEST DBFCDX
MEMVAR server, get, post, cookie, session
@@ -38,7 +43,8 @@ PROCEDURE Main()
ENDIF
rddSetDefault( "DBFCDX" )
SET( _SET_DATEFORMAT, "yyyy-mm-dd" )
SET DATE ANSI
SET CENTURY ON
IF ! hb_FileExists( "users.dbf" )

View File

@@ -3,5 +3,6 @@
#
hbhttpd.hbc
hbssl.hbc
-w3 -es2

View File

@@ -25,7 +25,6 @@ hbgs/hbgs.hbp
hbgt/hbgt.hbp
hbhpdf/hbhpdf.hbp # uses: libhpdf (locally hosted)
hbhttpd/hbhttpd.hbp
hbhttpd/hbhttpds.hbp
hblzf/hblzf.hbp # uses: liblzf (locally hosted)
hbmagic/hbmagic.hbp
hbmemio/hbmemio.hbp
@@ -45,7 +44,6 @@ hbsms/hbsms.hbp
hbsqlit3/hbsqlit3.hbp # uses: sqlite3 (locally hosted)
hbssl/hbssl.hbp
hbtip/hbtip.hbp
hbtip/hbtipssl.hbp
hbtinymt/hbtinymt.hbp
hbtpathy/hbtpathy.hbp
hbunix/hbunix.hbp

View File

@@ -8,12 +8,12 @@ incpaths=.
skip={dos}
{!(HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{ (HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}s${_HB_DYNSUFF}
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}s${_HB_DYNSUFF}
{unix}libs=ssl crypto
{os2}libs=libssl_s libcrypto_s
{!(HB_STATIC_OPENSSL&!hbdyn)&win}libs=ssleay32 libeay32
{ (HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32
{ (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
{ (HB_STATIC_OPENSSL&!hbdyn)&allwin}libs=crypt32
{!HB_DYNBIND_OPENSSL&unix}libs=ssl crypto
{!HB_DYNBIND_OPENSSL&os2}libs=libssl_s libcrypto_s
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&win}libs=ssleay32 libeay32
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allwin}libs=crypt32

View File

@@ -77,9 +77,9 @@
#include "simpleio.ch"
#endif
#if defined( HB_HAS_OPENSSL )
#include "hbssl.ch"
#endif
#include "hbssl.ch"
#undef __HBEXTREQ__
#include "hbssl.hbx"
#define RCV_BUF_SIZE Int( ::InetRcvBufSize( ::SocketCon ) / 2 )
#define SND_BUF_SIZE Int( ::InetSndBufSize( ::SocketCon ) / 2 )
@@ -120,11 +120,11 @@ CREATE CLASS tIPClient
VAR exGauge /* Gauge control; it can be a codeblock or a function pointer. */
VAR lTLS INIT .F.
#if defined( HB_HAS_OPENSSL )
VAR lHasSSL INIT tip_SSL()
VAR ssl_ctx
VAR ssl
VAR nSSLError INIT 0
#endif
VAR Cargo
@@ -159,6 +159,8 @@ CREATE CLASS tIPClient
METHOD InetTimeOut( SocketCon, nConnTimeout )
METHOD HasSSL() INLINE ::lHasSSL
PROTECTED:
VAR nLastError INIT 0
@@ -186,11 +188,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClient
LOCAL oLog
LOCAL aProtoAccepted := { "ftp", "http", "pop", "smtp" }
#if defined( HB_HAS_OPENSSL )
LOCAL aProtoAcceptedSSL := { "ftps", "https", "pop3s", "pops", "smtps" }
#else
LOCAL aProtoAcceptedSSL := {}
#endif
LOCAL aProtoAcceptedSSL := iif( ::lHasSSL, { "ftps", "https", "pop3s", "pops", "smtps" }, {} )
IF HB_ISSTRING( xTrace ) .OR. ;
( HB_ISLOGICAL( xTrace ) .AND. xTrace )
@@ -223,21 +221,21 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClient
IF ! ::bInitSocks
hb_inetInit()
#if defined( HB_HAS_OPENSSL )
SSL_init()
RAND_seed( Time() + hb_UserName() + DToS( Date() ) + hb_DirBase() + NetName() )
#endif
IF ::lHasSSL
SSL_init()
RAND_seed( Time() + hb_UserName() + DToS( Date() ) + hb_DirBase() + NetName() )
ENDIF
::bInitSocks := .T.
ENDIF
#if defined( HB_HAS_OPENSSL )
IF oURL:cProto == "ftps" .OR. ;
oURL:cProto == "https" .OR. ;
oURL:cProto == "pop3s" .OR. oURL:cProto == "pops" .OR. ;
oURL:cProto == "smtps"
::EnableTLS( .T. )
IF ::lHasSSL
IF oURL:cProto == "ftps" .OR. ;
oURL:cProto == "https" .OR. ;
oURL:cProto == "pop3s" .OR. oURL:cProto == "pops" .OR. ;
oURL:cProto == "smtps"
::EnableTLS( .T. )
ENDIF
ENDIF
#endif
::oUrl := oUrl
::oCredentials := oCredentials
@@ -287,23 +285,23 @@ METHOD EnableTLS( lEnable ) CLASS tIPClient
RETURN .T.
ENDIF
#if defined( HB_HAS_OPENSSL )
IF lEnable
::ssl_ctx := SSL_CTX_new()
::ssl := SSL_new( ::ssl_ctx )
::lTLS := .T.
lSuccess := .T.
IF ::lHasSSL
::ssl_ctx := SSL_CTX_new()
::ssl := SSL_new( ::ssl_ctx )
::lTLS := .T.
lSuccess := .T.
ELSE
lSuccess := .F.
ENDIF
ELSE
::lTLS := .F.
lSuccess := .T.
IF ::lHasSSL
::lTLS := .F.
lSuccess := .T.
ELSE
lSuccess := .T.
ENDIF
ENDIF
#else
IF lEnable
lSuccess := .F.
ELSE
lSuccess := .T.
ENDIF
#endif
RETURN lSuccess
@@ -374,13 +372,11 @@ METHOD Close() CLASS tIPClient
nRet := hb_inetClose( ::SocketCon )
#if defined( HB_HAS_OPENSSL )
IF ::lTLS
IF ::lHasSSL .AND. ::lTLS
SSL_shutdown( ::ssl )
::ssl := NIL
::ssl_ctx := NIL
ENDIF
#endif
::SocketCon := NIL
::isOpen := .F.
@@ -432,11 +428,11 @@ METHOD Read( nLen ) CLASS tIPClient
cStr0 := Space( nLen )
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
/* Getting around implementing the hack used in non-SSL branch for now.
IMO the proper fix would have been done to hb_inetRecvAll(). [vszakats] */
::nLastRead := ::InetRecvAll( ::SocketCon, @cStr0, nLen )
#endif
IF ::lHasSSL
/* Getting around implementing the hack used in non-SSL branch for now.
IMO the proper fix would have been done to hb_inetRecvAll(). [vszakats] */
::nLastRead := ::InetRecvAll( ::SocketCon, @cStr0, nLen )
ENDIF
ELSE
// S.R. if len of file is less than RCV_BUF_SIZE hb_inetRecvAll return 0
// ::nLastRead := ::InetRecvAll( ::SocketCon, @cStr0, nLen )
@@ -603,15 +599,15 @@ METHOD InetSendAll( SocketCon, cData, nLen ) CLASS tIPClient
ENDIF
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
IF ::lHasSSL
#if defined( _SSL_DEBUG_TEMP )
? "SSL_WRITE()", cData
#endif
nRet := SSL_write( ::ssl, cData, nLen )
::nSSLError := iif( nRet < 0, nRet, 0 )
#else
nRet := 0
? "SSL_WRITE()", cData
#endif
nRet := SSL_write( ::ssl, cData, nLen )
::nSSLError := iif( nRet < 0, nRet, 0 )
ELSE
nRet := 0
ENDIF
ELSE
nRet := hb_inetSendAll( SocketCon, cData, nLen )
ENDIF
@@ -637,15 +633,15 @@ METHOD InetRecv( SocketCon, cStr1, len ) CLASS tIPClient
LOCAL nRet
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
IF ::lHasSSL
#if defined( _SSL_DEBUG_TEMP )
? "SSL_READ()"
#endif
nRet := SSL_read( ::ssl, @cStr1, len )
::nSSLError := iif( nRet < 0, nRet, 0 )
#else
nRet := 0
? "SSL_READ()"
#endif
nRet := SSL_read( ::ssl, @cStr1, len )
::nSSLError := iif( nRet < 0, nRet, 0 )
ELSE
nRet := 0
ENDIF
ELSE
nRet := hb_inetRecv( SocketCon, @cStr1, len )
ENDIF
@@ -661,19 +657,19 @@ METHOD InetRecvLine( SocketCon, nRet, size ) CLASS tIPClient
LOCAL cRet
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
nRet := hb_SSL_read_line( ::ssl, @cRet, size, ::nConnTimeout )
IF ::lHasSSL
nRet := hb_SSL_read_line( ::ssl, @cRet, size, ::nConnTimeout )
#if defined( _SSL_DEBUG_TEMP )
? "HB_SSL_READ_LINE()", cRet
? "HB_SSL_READ_LINE()", cRet
#endif
IF nRet == 0 .OR. Empty( cRet )
cRet := NIL
IF nRet == 0 .OR. Empty( cRet )
cRet := NIL
ENDIF
::nSSLError := iif( nRet < 0, nRet, 0 )
ELSE
cRet := ""
nRet := 0
ENDIF
::nSSLError := iif( nRet < 0, nRet, 0 )
#else
cRet := ""
nRet := 0
#endif
ELSE
cRet := hb_inetRecvLine( SocketCon, @nRet, size )
ENDIF
@@ -689,19 +685,19 @@ METHOD InetRecvAll( SocketCon, cRet, size ) CLASS tIPClient
LOCAL nRet
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
nRet := hb_SSL_read_all( ::ssl, @cRet, size, ::nConnTimeout )
IF ::lHasSSL
nRet := hb_SSL_read_all( ::ssl, @cRet, size, ::nConnTimeout )
#if defined( _SSL_DEBUG_TEMP )
? "HB_SSL_READ_ALL()", cRet
? "HB_SSL_READ_ALL()", cRet
#endif
IF nRet == 0 .OR. Empty( cRet )
cRet := NIL
IF nRet == 0 .OR. Empty( cRet )
cRet := NIL
ENDIF
::nSSLError := iif( nRet < 0, nRet, 0 )
ELSE
cRet := ""
nRet := 0
ENDIF
::nSSLError := iif( nRet < 0, nRet, 0 )
#else
cRet := ""
nRet := 0
#endif
ELSE
nRet := hb_inetRecvAll( SocketCon, @cRet, size )
ENDIF
@@ -717,11 +713,11 @@ METHOD InetErrorCode( SocketCon ) CLASS tIPClient
LOCAL nRet
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
nRet := iif( ::nSSLError == 0, 0, SSL_get_error( ::ssl, ::nSSLError ) )
#else
nRet := 0
#endif
IF ::lHasSSL
nRet := iif( ::nSSLError == 0, 0, SSL_get_error( ::ssl, ::nSSLError ) )
ELSE
nRet := 0
ENDIF
ELSE
nRet := hb_inetErrorCode( SocketCon )
ENDIF
@@ -742,11 +738,11 @@ METHOD InetErrorDesc( SocketCon ) CLASS tIPClient
IF ! Empty( SocketCon )
IF ::lTLS
#if defined( HB_HAS_OPENSSL )
IF ::nSSLError != 0
cMsg := ERR_error_string( SSL_get_error( ::ssl, ::nSSLError ) )
IF ::lHasSSL
IF ::nSSLError != 0
cMsg := ERR_error_string( SSL_get_error( ::ssl, ::nSSLError ) )
ENDIF
ENDIF
#endif
ELSE
cMsg := hb_inetErrorDesc( SocketCon )
ENDIF
@@ -767,14 +763,12 @@ METHOD InetConnect( cServer, nPort, SocketCon ) CLASS tIPClient
::InetRcvBufSize( SocketCon, ::nDefaultRcvBuffSize )
ENDIF
#if defined( HB_HAS_OPENSSL )
IF ::lTLS
IF ::lHasSSL .AND. ::lTLS
SSL_set_mode( ::ssl, HB_SSL_MODE_AUTO_RETRY )
SSL_set_fd( ::ssl, hb_inetFD( SocketCon ) )
SSL_connect( ::ssl )
/* TODO: Add error handling */
ENDIF
#endif
IF HB_ISBLOCK( ::bTrace )
::Log( cServer, nPort, SocketCon )
@@ -859,9 +853,4 @@ METHOD SetProxy( cProxyHost, nProxyPort, cProxyUser, cProxyPassword ) CLASS tIPC
RETURN Self
FUNCTION tip_SSL()
#if defined( HB_HAS_OPENSSL )
RETURN .T.
#else
RETURN .F.
#endif
RETURN hb_IsFunction( "__HBEXTERN__HBSSL__" )

View File

@@ -2,13 +2,8 @@
# $Id$
#
# Set HB_TIP_OPENSSL envvar to 'yes' or use -env:HB_TIP_OPENSSL=yes
# hbmk2 option to switch to the SSL-enabled version of this library.
description=TCP/IP-specific communication protocol functions
incpaths=.
{!HB_TIP_OPENSSL|dos}libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{HB_TIP_OPENSSL&!dos}libs=${_HB_DYNPREF}${hb_name}ssl${_HB_DYNSUFF}
{HB_TIP_OPENSSL&!dos}libs=hbssl.hbc
libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}

View File

@@ -1,34 +0,0 @@
#
# $Id$
#
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
hbtip.hbx
encurlc.c
utils.c
cgi.prg
client.prg
credent.prg
encb64.prg
encoder.prg
encqp.prg
encurl.prg
ftpcli.prg
httpcli.prg
log.prg
mail.prg
popcli.prg
sendmail.prg
sessid.prg
smtpcli.prg
thtml.prg
url.prg

View File

@@ -2,4 +2,37 @@
# $Id$
#
hbtip.hbm
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
hbtip.hbx
encurlc.c
utils.c
cgi.prg
client.prg
credent.prg
encb64.prg
encoder.prg
encqp.prg
encurl.prg
ftpcli.prg
httpcli.prg
log.prg
mail.prg
popcli.prg
sendmail.prg
sessid.prg
smtpcli.prg
thtml.prg
url.prg
-env:HB_DYNBIND_OPENSSL=yes
hbssl.hbc

View File

@@ -1,11 +0,0 @@
#
# $Id$
#
-hbx=
hbtip.hbm
hbssl.hbc
-DHB_HAS_OPENSSL

View File

@@ -253,10 +253,8 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ;
lAuthLogin := .T.
ELSEIF "PLAIN" $ oInMail:cReply
lAuthPlain := .T.
#if defined( HB_HAS_OPENSSL )
ELSEIF "STARTTLS" $ oInMail:cReply
ELSEIF oInMail:HasSSL() .AND. "STARTTLS" $ oInMail:cReply
lAuthTLS := .T.
#endif
ELSEIF Left( oInMail:cReply, 4 ) == "250 "
EXIT
ENDIF

View File

@@ -7,12 +7,20 @@
* www - http://harbour-project.org
*/
#require "hbssl"
#require "hbtip"
REQUEST __HBEXTERN__HBSSL__
#include "simpleio.ch"
PROCEDURE Main( cFrom, cPassword, cTo )
IF ! tip_SSL()
? "Error: Requires SSL support"
RETURN
ENDIF
hb_default( @cFrom , "<myname@gmail.com>" )
hb_default( @cPassword, "<mypassword>" )
hb_default( @cTo , "addressee@domain.com" )

View File

@@ -64,18 +64,19 @@ typedef HRESULT ( CALLBACK * PHB_AX_GETCTRL )( HWND, IUnknown** );
static HMODULE s_hLib = NULL;
static PHB_AX_GETCTRL s_pAtlAxGetControl = NULL;
static PHB_AX_GETCTRL s_pAtlAxGetControl = NULL;
static void hb_errRT_OLE( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, HB_ERRCODE errOsCode, const char * szDescription, const char * szOperation )
{
PHB_ITEM pError;
pError = hb_errRT_New( ES_ERROR, "WINOLE", errGenCode, errSubCode, szDescription, szOperation, errOsCode, EF_NONE );
if( hb_pcount() != 0 )
{
/* HB_ERR_ARGS_BASEPARAMS */
PHB_ITEM pArray = hb_arrayBaseParams();
PHB_ITEM pArray = hb_arrayBaseParams();
hb_errPutArgsArray( pError, pArray );
hb_itemRelease( pArray );
}
@@ -84,7 +85,7 @@ static void hb_errRT_OLE( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, HB_ERRCO
}
static void hb_oleAxExit( void* cargo )
static void hb_oleAxExit( void * cargo )
{
HB_SYMBOL_UNUSED( cargo );
@@ -132,8 +133,8 @@ HB_FUNC( WIN_AXINIT )
PHB_ITEM hb_oleAxControlNew( PHB_ITEM pItem, HWND hWnd )
{
IUnknown* pUnk = NULL;
IDispatch* pDisp = NULL;
IUnknown * pUnk = NULL;
IDispatch * pDisp = NULL;
HRESULT lOleError;
if( pItem )
@@ -150,7 +151,7 @@ PHB_ITEM hb_oleAxControlNew( PHB_ITEM pItem, HWND hWnd )
if( lOleError == S_OK )
{
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( IID_IDispatch ), ( void** ) ( void * ) &pDisp );
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( IID_IDispatch ), ( void ** ) ( void * ) &pDisp );
if( lOleError == S_OK )
pItem = hb_oleItemPut( pItem, pDisp );
@@ -180,9 +181,9 @@ HB_FUNC( __AXGETCONTROL ) /* ( hWnd ) --> pDisp */
HB_FUNC( __AXDOVERB ) /* ( hWndAx, iVerb ) --> hResult */
{
HWND hWnd = ( HWND ) hb_parptr( 1 );
IUnknown* pUnk = NULL;
HRESULT lOleError;
HWND hWnd = ( HWND ) hb_parptr( 1 );
IUnknown * pUnk = NULL;
HRESULT lOleError;
if( ! hb_oleAxInit() || ! s_pAtlAxGetControl )
{
@@ -195,14 +196,14 @@ HB_FUNC( __AXDOVERB ) /* ( hWndAx, iVerb ) --> hResult */
if( lOleError == S_OK )
{
IOleObject *lpOleObject = NULL;
IOleObject * lpOleObject = NULL;
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( IID_IOleObject ), ( void** ) ( void* ) &lpOleObject );
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( IID_IOleObject ), ( void ** ) ( void * ) &lpOleObject );
if( lOleError == S_OK )
{
IOleClientSite* lpOleClientSite;
IOleClientSite * lpOleClientSite;
lOleError = HB_VTBL( lpOleObject )->GetClientSite( HB_THIS_( lpOleObject ) &lpOleClientSite );
lOleError = HB_VTBL( lpOleObject )->GetClientSite( HB_THIS_( lpOleObject ) & lpOleClientSite );
if( lOleError == S_OK )
{
MSG Msg;
@@ -225,7 +226,7 @@ HB_FUNC( __AXDOVERB ) /* ( hWndAx, iVerb ) --> hResult */
/* ======================== Event handler support ======================== */
#if !defined( HB_OLE_C_API )
#if ! defined( HB_OLE_C_API )
typedef struct
{
HRESULT ( STDMETHODCALLTYPE * QueryInterface ) ( IDispatch*, REFIID, void** );
@@ -250,13 +251,13 @@ typedef struct {
} ISink;
static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch* lpThis, REFIID riid, void** ppRet )
static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch * lpThis, REFIID riid, void ** ppRet )
{
if( IsEqualIID( riid, HB_ID_REF( IID_IUnknown ) ) ||
IsEqualIID( riid, HB_ID_REF( IID_IDispatch ) ) ||
IsEqualIID( riid, HB_ID_REF( ( ( ISink* ) lpThis )->rriid ) ) )
IsEqualIID( riid, HB_ID_REF( ( ( ISink * ) lpThis )->rriid ) ) )
{
*ppRet = ( void* ) lpThis;
*ppRet = ( void * ) lpThis;
HB_VTBL( lpThis )->AddRef( HB_THIS( lpThis ) );
return S_OK;
}
@@ -265,15 +266,15 @@ static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch* lpThis, REFIID riid,
}
static ULONG STDMETHODCALLTYPE AddRef( IDispatch* lpThis )
static ULONG STDMETHODCALLTYPE AddRef( IDispatch * lpThis )
{
return ++( ( ISink* ) lpThis )->count;
return ++( ( ISink * ) lpThis )->count;
}
static ULONG STDMETHODCALLTYPE Release( IDispatch* lpThis )
static ULONG STDMETHODCALLTYPE Release( IDispatch * lpThis )
{
ISink* pSink = ( ISink* ) lpThis;
ISink * pSink = ( ISink * ) lpThis;
if( --pSink->count == 0 )
{
@@ -296,7 +297,7 @@ static ULONG STDMETHODCALLTYPE Release( IDispatch* lpThis )
}
static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IDispatch* lpThis, UINT* pInfoCount )
static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IDispatch * lpThis, UINT * pInfoCount )
{
HB_SYMBOL_UNUSED( lpThis );
HB_SYMBOL_UNUSED( pInfoCount );
@@ -304,7 +305,7 @@ static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IDispatch* lpThis, UINT* pInf
}
static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch* lpThis, UINT iTInfo, LCID lcid, ITypeInfo** ppTypeInfo )
static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch * lpThis, UINT iTInfo, LCID lcid, ITypeInfo ** ppTypeInfo )
{
HB_SYMBOL_UNUSED( lpThis );
HB_SYMBOL_UNUSED( iTInfo );
@@ -314,7 +315,7 @@ static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch* lpThis, UINT iTInfo, LC
}
static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch* lpThis, REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId )
static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch * lpThis, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId )
{
HB_SYMBOL_UNUSED( lpThis );
HB_SYMBOL_UNUSED( riid );
@@ -326,10 +327,10 @@ static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch* lpThis, REFIID riid,
}
static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS* pParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo,
UINT* puArgErr )
static HRESULT STDMETHODCALLTYPE Invoke( IDispatch * lpThis, DISPID dispid, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS * pParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
UINT * puArgErr )
{
PHB_ITEM pAction;
HRESULT hr;
@@ -344,7 +345,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
hr = DISP_E_MEMBERNOTFOUND;
pAction = ( ( ISink* ) lpThis )->pItemHandler;
pAction = ( ( ISink * ) lpThis )->pItemHandler;
if( pAction )
{
PHB_ITEM pKey = hb_itemPutNL( hb_stackAllocItem(), ( long ) dispid );
@@ -355,9 +356,9 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
pKey = NULL;
}
if( pAction && hb_oleDispInvoke( NULL, pAction, pKey,
pParams, pVarResult, NULL,
( ( ISink* ) lpThis )->uiClass ) )
if( pAction && hb_oleDispInvoke( NULL, pAction, pKey,
pParams, pVarResult, NULL,
( ( ISink * ) lpThis )->uiClass ) )
hr = S_OK;
hb_stackPop();
@@ -382,9 +383,9 @@ static const IDispatchVtbl ISink_Vtbl = {
/* Debug helper function */
static char * GUID2String( GUID * pID )
{
static char strguid[ 128 ];
wchar_t olestr[ 128 ];
int iLen;
static char strguid[ 128 ];
wchar_t olestr[ 128 ];
int iLen;
StringFromGUID2( pID, olestr, HB_SIZEOFARRAY( olestr ) );
iLen = WideCharToMultiByte( CP_ACP, 0, olestr, -1, strguid, sizeof( strguid ), NULL, NULL );
@@ -396,12 +397,12 @@ static char * GUID2String( GUID * pID )
static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID * piid )
{
ITypeInfo * iTI;
ITypeInfo * iTISink;
TYPEATTR * pTypeAttr;
HREFTYPE hRefType;
HRESULT hr;
int iFlags, i, j;
ITypeInfo * iTI;
ITypeInfo * iTISink;
TYPEATTR * pTypeAttr;
HREFTYPE hRefType;
HRESULT hr;
int iFlags, i, j;
if( ! szEvent )
{
@@ -410,10 +411,10 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
/* Method 1: using IProvideClassInfo2 */
hr = HB_VTBL( iDisp )->QueryInterface( HB_THIS_( iDisp ) HB_ID_REF( IID_IProvideClassInfo2 ), ( void** ) ( void* ) &iPCI2 );
hr = HB_VTBL( iDisp )->QueryInterface( HB_THIS_( iDisp ) HB_ID_REF( IID_IProvideClassInfo2 ), ( void ** ) ( void * ) &iPCI2 );
if( hr == S_OK )
{
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink IProvideClassInfo2 OK") );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink IProvideClassInfo2 OK" ) );
hr = HB_VTBL( iPCI2 )->GetGUID( HB_THIS_( iPCI2 ) GUIDKIND_DEFAULT_SOURCE_DISP_IID, piid );
HB_VTBL( iPCI2 )->Release( HB_THIS( iPCI2 ) );
@@ -422,21 +423,21 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
}
else
{
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink IProvideClassInfo2 obtain error %08lX", hr) );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink IProvideClassInfo2 obtain error %08lX", hr ) );
}
/* Method 2: using IProvideClassInfo and searching for default source in ITypeInfo */
hr = HB_VTBL( iDisp )->QueryInterface( HB_THIS_( iDisp ) HB_ID_REF( IID_IProvideClassInfo ), ( void** ) ( void* ) &iPCI );
hr = HB_VTBL( iDisp )->QueryInterface( HB_THIS_( iDisp ) HB_ID_REF( IID_IProvideClassInfo ), ( void ** ) ( void * ) &iPCI );
if( hr == S_OK )
{
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink IProvideClassInfo OK") );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink IProvideClassInfo OK" ) );
hr = HB_VTBL( iPCI )->GetClassInfo( HB_THIS_( iPCI ) &iTI );
hr = HB_VTBL( iPCI )->GetClassInfo( HB_THIS_( iPCI ) & iTI );
if( hr == S_OK )
{
hr = HB_VTBL( iTI )->GetTypeAttr( HB_THIS_( iTI ) &pTypeAttr );
hr = HB_VTBL( iTI )->GetTypeAttr( HB_THIS_( iTI ) & pTypeAttr );
if( hr == S_OK )
{
for( i = 0; i < pTypeAttr->cImplTypes; i++ )
@@ -447,12 +448,12 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
if( HB_VTBL( iTI )->GetRefTypeOfImplType( HB_THIS_( iTI ) i, &hRefType ) == S_OK &&
HB_VTBL( iTI )->GetRefTypeInfo( HB_THIS_( iTI ) hRefType, &iTISink ) == S_OK )
{
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink Method 2: default source is found") );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink Method 2: default source is found" ) );
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) &pTypeAttr );
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) & pTypeAttr );
if( hr == S_OK )
{
* piid = pTypeAttr->guid;
*piid = pTypeAttr->guid;
HB_VTBL( iTISink )->ReleaseTypeAttr( HB_THIS_( iTISink ) pTypeAttr );
HB_VTBL( iTI )->ReleaseTypeAttr( HB_THIS_( iTI ) pTypeAttr );
@@ -469,7 +470,7 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
}
else
{
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink IProvideClassInfo obtain error %08lX", hr) );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink IProvideClassInfo obtain error %08lX", hr ) );
}
}
@@ -479,10 +480,10 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
hr = HB_VTBL( iDisp )->GetTypeInfo( HB_THIS_( iDisp ) 0, LOCALE_SYSTEM_DEFAULT, &iTI );
if( hr == S_OK )
{
ITypeLib * iTL;
TYPEATTR * pTypeAttr2;
ITypeLib * iTL;
TYPEATTR * pTypeAttr2;
hr = HB_VTBL( iTI )->GetContainingTypeLib( HB_THIS_( iTI ) &iTL, NULL );
hr = HB_VTBL( iTI )->GetContainingTypeLib( HB_THIS_( iTI ) & iTL, NULL );
HB_VTBL( iTI )->Release( HB_THIS( iTI ) );
if( hr == S_OK )
@@ -493,7 +494,7 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
hr = HB_VTBL( iTL )->GetTypeInfo( HB_THIS_( iTL ) i, &iTI );
if( hr == S_OK )
{
hr = HB_VTBL( iTI )->GetTypeAttr( HB_THIS_( iTI ) &pTypeAttr );
hr = HB_VTBL( iTI )->GetTypeAttr( HB_THIS_( iTI ) & pTypeAttr );
if( hr == S_OK )
{
if( pTypeAttr->typekind == TKIND_COCLASS )
@@ -505,22 +506,22 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
if( HB_VTBL( iTI )->GetRefTypeOfImplType( HB_THIS_( iTI ) j, &hRefType ) == S_OK &&
HB_VTBL( iTI )->GetRefTypeInfo( HB_THIS_( iTI ) hRefType, &iTISink ) == S_OK )
{
BSTR bstr;
BSTR bstr;
hr = HB_VTBL( iTISink )->GetDocumentation( HB_THIS_( iTISink ) -1, &bstr, NULL, NULL, NULL );
hr = HB_VTBL( iTISink )->GetDocumentation( HB_THIS_( iTISink ) - 1, &bstr, NULL, NULL, NULL );
if( hr == S_OK )
{
char str[ 256 ];
int iLen;
char str[ 256 ];
int iLen;
iLen = WideCharToMultiByte( CP_ACP, 0, bstr, -1, str, sizeof( str ), NULL, NULL );
str[ iLen - 1 ] = '\0';
if( ! strcmp( szEvent, str ) )
{
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) &pTypeAttr2 );
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) & pTypeAttr2 );
if( hr == S_OK )
{
* piid = pTypeAttr2->guid;
*piid = pTypeAttr2->guid;
HB_VTBL( iTISink )->ReleaseTypeAttr( HB_THIS_( iTISink ) pTypeAttr2 );
HB_VTBL( iTISink )->Release( HB_THIS( iTISink ) );
@@ -543,21 +544,21 @@ static HRESULT _get_default_sink( IDispatch * iDisp, const char * szEvent, IID *
if( HB_VTBL( iTI )->GetRefTypeOfImplType( HB_THIS_( iTI ) j, &hRefType ) == S_OK &&
HB_VTBL( iTI )->GetRefTypeInfo( HB_THIS_( iTI ) hRefType, &iTISink ) == S_OK )
{
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) &pTypeAttr2 );
hr = HB_VTBL( iTISink )->GetTypeAttr( HB_THIS_( iTISink ) & pTypeAttr2 );
if( hr == S_OK )
{
#if 0
/* Debug code. You can also comment out iFlags condition, to list more interfaces [Mindaugas] */
BSTR bstr;
char str[ 256 ];
int iLen;
char str[ 256 ];
int iLen;
HB_VTBL( iTISink )->GetDocumentation( HB_THIS_( iTISink ) -1, &bstr, NULL, NULL, NULL );
HB_VTBL( iTISink )->GetDocumentation( HB_THIS_( iTISink ) - 1, &bstr, NULL, NULL, NULL );
iLen = WideCharToMultiByte( CP_ACP, 0, bstr, -1, str, sizeof( str ), NULL, NULL );
str[ iLen - 1 ] = '\0';
HB_TRACE( HB_TR_DEBUG, ("_get_default_sink Method 3: iFlags=%d guid=%s class=%s", iFlags, GUID2String( &( pTypeAttr2->guid ) ), str) );
HB_TRACE( HB_TR_DEBUG, ( "_get_default_sink Method 3: iFlags=%d guid=%s class=%s", iFlags, GUID2String( &( pTypeAttr2->guid ) ), str ) );
#endif
* piid = pTypeAttr2->guid;
*piid = pTypeAttr2->guid;
HB_VTBL( iTISink )->ReleaseTypeAttr( HB_THIS_( iTISink ) pTypeAttr2 );
HB_VTBL( iTI )->ReleaseTypeAttr( HB_THIS_( iTI ) pTypeAttr );
@@ -588,8 +589,8 @@ static void hb_sink_destruct( void * cargo )
if( pSink->pConnectionPoint )
{
IConnectionPoint* pConnectionPoint = pSink->pConnectionPoint;
DWORD dwCookie = pSink->dwCookie;
IConnectionPoint * pConnectionPoint = pSink->pConnectionPoint;
DWORD dwCookie = pSink->dwCookie;
/* Unadvise() may activate pSink destructor so clear these
* items as protection against recursive Unadvise call.
@@ -625,7 +626,7 @@ HB_FUNC( __AXREGISTERHANDLER ) /* ( pDisp, bHandler [, cIID] ) --> pSink */
szIID = hb_parc( 3 );
if( szIID && szIID[ 0 ] == '{' )
{
const wchar_t * wCLSID;
const wchar_t * wCLSID;
wCLSID = hb_parstr_u16( 3, HB_CDP_ENDIAN_NATIVE, &hCLSID, NULL );
lOleError = CLSIDFromString( ( wchar_t * ) wCLSID, &rriid );
@@ -637,9 +638,9 @@ HB_FUNC( __AXREGISTERHANDLER ) /* ( pDisp, bHandler [, cIID] ) --> pSink */
if( lOleError == S_OK )
{
#if 0
HB_TRACE( HB_TR_DEBUG, ("__AXREGISTERHANDLER using sink %s", GUID2String( &rriid )) );
HB_TRACE( HB_TR_DEBUG, ( "__AXREGISTERHANDLER using sink %s", GUID2String( &rriid ) ) );
#endif
lOleError = HB_VTBL( pDisp )->QueryInterface( HB_THIS_( pDisp ) HB_ID_REF( IID_IConnectionPointContainer ), ( void** ) ( void* ) &pCPC );
lOleError = HB_VTBL( pDisp )->QueryInterface( HB_THIS_( pDisp ) HB_ID_REF( IID_IConnectionPointContainer ), ( void ** ) ( void * ) &pCPC );
if( lOleError == S_OK )
{
@@ -651,7 +652,7 @@ HB_FUNC( __AXREGISTERHANDLER ) /* ( pDisp, bHandler [, cIID] ) --> pSink */
DWORD dwCookie = 0;
ISink * pSink;
pSink = ( ISink* ) hb_xgrab( sizeof( ISink ) ); /* TODO: GlobalAlloc/Free GMEM_FIXED ??? */
pSink = ( ISink * ) hb_xgrab( sizeof( ISink ) ); /* TODO: GlobalAlloc/Free GMEM_FIXED ??? */
pSink->lpVtbl = &ISink_Vtbl;
pSink->count = 0;
@@ -663,7 +664,7 @@ HB_FUNC( __AXREGISTERHANDLER ) /* ( pDisp, bHandler [, cIID] ) --> pSink */
pSink->dwCookie = dwCookie;
HB_VTBL( pDisp )->AddRef( HB_THIS( pDisp ) );
pOleItem = hb_oleItemPut( hb_stackReturnItem(), ( IDispatch* ) pDisp );
pOleItem = hb_oleItemPut( hb_stackReturnItem(), ( IDispatch * ) pDisp );
/* bind call back handler item with returned object */
hb_oleItemSetCallBack( pOleItem, &pSink->pItemHandler );
/* add additional destructor */

View File

@@ -58,19 +58,19 @@
#include <olectl.h>
#include <tchar.h>
#define MAX_CLSID_SIZE 64
#define MAX_CLSNAME_SIZE 256
#define MAX_REGSTR_SIZE ( MAX_CLSNAME_SIZE + 64 )
#define REGTABLE_SIZE ( sizeof( s_regTable ) / sizeof( *s_regTable ) )
#define MAX_CLSID_SIZE 64
#define MAX_CLSNAME_SIZE 256
#define MAX_REGSTR_SIZE ( MAX_CLSNAME_SIZE + 64 )
#define REGTABLE_SIZE ( sizeof( s_regTable ) / sizeof( *s_regTable ) )
static const char *s_regTable[][ 3 ] =
static const char * s_regTable[][ 3 ] =
{
{ "CLSID\\@", 0, "$" },
{ "CLSID\\@\\InprocServer32", 0, ( const char* ) -1 },
{ "CLSID\\@\\InprocServer32", "ThreadingModel", "Apartment" },
{ "CLSID\\@\\ProgId", 0, "$" },
{ "$", 0, "$" },
{ "$\\CLSID", 0, "@" }
{ "CLSID\\@", 0, "$" },
{ "CLSID\\@\\InprocServer32", 0, ( const char * ) -1 },
{ "CLSID\\@\\InprocServer32", "ThreadingModel", "Apartment" },
{ "CLSID\\@\\ProgId", 0, "$" },
{ "$", 0, "$" },
{ "$\\CLSID", 0, "@" }
};
static LONG s_lLockCount;
@@ -81,10 +81,10 @@ static GUID s_IID_IHbOleServer;
static char s_szClsId[ MAX_CLSID_SIZE ] = "";
static char s_szClsName[ MAX_CLSNAME_SIZE ] = "";
static HB_BOOL s_fServerReady = HB_FALSE;
static HB_BOOL s_fHashClone = HB_FALSE;
static PHB_ITEM s_pAction = NULL;
static PHB_ITEM s_pMsgHash = NULL;
static HB_BOOL s_fServerReady = HB_FALSE;
static HB_BOOL s_fHashClone = HB_FALSE;
static PHB_ITEM s_pAction = NULL;
static PHB_ITEM s_pMsgHash = NULL;
static HINSTANCE s_hInstDll;
@@ -115,7 +115,7 @@ static void hb_errRT_OLESRV( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, HB_ER
if( hb_pcount() != 0 )
{
/* HB_ERR_ARGS_BASEPARAMS */
PHB_ITEM pArray = hb_arrayBaseParams();
PHB_ITEM pArray = hb_arrayBaseParams();
hb_errPutArgsArray( pError, pArray );
hb_itemRelease( pArray );
}
@@ -130,23 +130,24 @@ static HB_BOOL s_hashWithNumKeys( PHB_ITEM pHash )
for( n = 1; n <= nLen; ++n )
{
PHB_ITEM pKey = hb_hashGetKeyAt( pHash, n );
if( !pKey || !HB_IS_NUMERIC( pKey ) )
if( ! pKey || ! HB_IS_NUMERIC( pKey ) )
return HB_FALSE;
}
return HB_TRUE;
}
static wchar_t* s_AnsiToWideBuffer( const char* szString, wchar_t* szWide, int iLen )
static wchar_t * s_AnsiToWideBuffer( const char * szString, wchar_t * szWide, int iLen )
{
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szString, -1, szWide, iLen );
szWide[ iLen - 1 ] = L'\0';
return szWide;
}
static int s_WideToAnsiBuffer( const wchar_t* wszString, char* szBuffer, int iLen )
static int s_WideToAnsiBuffer( const wchar_t * wszString, char * szBuffer, int iLen )
{
int iResult = WideCharToMultiByte( CP_ACP, 0, wszString, -1, szBuffer, iLen, NULL, NULL );
szBuffer[ iLen - 1 ] = '\0';
return iResult;
}
@@ -156,7 +157,7 @@ static HB_BOOL s_getKeyValue( const char * pszKey, LPTSTR lpBuffer, int iLen )
char pszBuffer[ MAX_REGSTR_SIZE ], * pszPtr;
int iSize, iPos, iCount;
if( pszKey == ( const char* ) -1 )
if( pszKey == ( const char * ) -1 )
return GetModuleFileName( s_hInstDll, lpBuffer, iLen );
pszPtr = pszBuffer;
@@ -207,7 +208,7 @@ static HB_BOOL s_getKeyValue( const char * pszKey, LPTSTR lpBuffer, int iLen )
/* IHbOleServer
*/
#if !defined( HB_OLE_C_API )
#if ! defined( HB_OLE_C_API )
typedef struct
{
HRESULT ( STDMETHODCALLTYPE * QueryInterface ) ( IDispatch*, REFIID, void** );
@@ -220,21 +221,22 @@ typedef struct
} IDispatchVtbl;
#endif
typedef struct {
const IDispatchVtbl* lpVtbl;
typedef struct
{
const IDispatchVtbl * lpVtbl;
DWORD count;
PHB_ITEM pAction;
HB_BOOL fGuids;
} IHbOleServer;
static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch* lpThis,
REFIID riid, void** ppRet )
static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch * lpThis,
REFIID riid, void ** ppRet )
{
if( IsEqualIID( riid, HB_ID_REF( IID_IUnknown ) ) ||
IsEqualIID( riid, HB_ID_REF( IID_IDispatch ) ) )
{
*ppRet = ( void* ) lpThis;
*ppRet = ( void * ) lpThis;
HB_VTBL( lpThis )->AddRef( HB_THIS( lpThis ) );
return S_OK;
}
@@ -242,12 +244,12 @@ static HRESULT STDMETHODCALLTYPE QueryInterface( IDispatch* lpThis,
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE AddRef( IDispatch* lpThis )
static ULONG STDMETHODCALLTYPE AddRef( IDispatch * lpThis )
{
return ++( ( IHbOleServer * ) lpThis )->count;
}
static ULONG STDMETHODCALLTYPE Release( IDispatch* lpThis )
static ULONG STDMETHODCALLTYPE Release( IDispatch * lpThis )
{
IHbOleServer * pHbOleServer = ( IHbOleServer * ) lpThis;
@@ -265,16 +267,16 @@ static ULONG STDMETHODCALLTYPE Release( IDispatch* lpThis )
return pHbOleServer->count;
}
static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IDispatch* lpThis,
UINT* pInfoCount )
static HRESULT STDMETHODCALLTYPE GetTypeInfoCount( IDispatch * lpThis,
UINT * pInfoCount )
{
HB_SYMBOL_UNUSED( lpThis );
HB_SYMBOL_UNUSED( pInfoCount );
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch* lpThis, UINT iTInfo,
LCID lcid, ITypeInfo** ppTypeInfo )
static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch * lpThis, UINT iTInfo,
LCID lcid, ITypeInfo ** ppTypeInfo )
{
HB_SYMBOL_UNUSED( lpThis );
HB_SYMBOL_UNUSED( iTInfo );
@@ -283,10 +285,10 @@ static HRESULT STDMETHODCALLTYPE GetTypeInfo( IDispatch* lpThis, UINT iTInfo,
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch* lpThis, REFIID riid,
LPOLESTR* rgszNames,
static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch * lpThis, REFIID riid,
LPOLESTR * rgszNames,
UINT cNames, LCID lcid,
DISPID* rgDispId )
DISPID * rgDispId )
{
HRESULT hr = S_OK;
@@ -308,7 +310,7 @@ static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch* lpThis, REFIID riid,
PHB_ITEM pAction;
pAction = ( ( IHbOleServer * ) lpThis )->pAction;
if( !pAction )
if( ! pAction )
pAction = s_pAction;
if( pAction )
{
@@ -365,10 +367,10 @@ static HRESULT STDMETHODCALLTYPE GetIDsOfNames( IDispatch* lpThis, REFIID riid,
return hr;
}
static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS* pParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo,
UINT* puArgErr )
static HRESULT STDMETHODCALLTYPE Invoke( IDispatch * lpThis, DISPID dispid, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS * pParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
UINT * puArgErr )
{
PHB_DYNS pDynSym;
PHB_ITEM pAction;
@@ -382,7 +384,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
return DISP_E_UNKNOWNINTERFACE;
pAction = ( ( IHbOleServer * ) lpThis )->pAction;
if( !pAction )
if( ! pAction )
pAction = s_pAction;
if( pAction )
@@ -462,13 +464,13 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
s_objItemToVariant, uiClass );
}
}
if( !fResult )
if( ! fResult )
return DISP_E_MEMBERNOTFOUND;
}
else
{
pDynSym = hb_dispIdToDynsym( dispid );
if( !pDynSym )
if( ! pDynSym )
return DISP_E_MEMBERNOTFOUND;
if( wFlags & DISPATCH_PROPERTYPUT )
@@ -498,11 +500,11 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
return S_OK;
}
else if( ( wFlags & DISPATCH_METHOD ) == 0 ||
!hb_dynsymIsFunction( pDynSym ) )
! hb_dynsymIsFunction( pDynSym ) )
return DISP_E_MEMBERNOTFOUND;
else if( !hb_oleDispInvoke( hb_dynsymSymbol( pDynSym ),
NULL, NULL, pParams, pVarResult,
s_objItemToVariant, uiClass ) )
else if( ! hb_oleDispInvoke( hb_dynsymSymbol( pDynSym ),
NULL, NULL, pParams, pVarResult,
s_objItemToVariant, uiClass ) )
return DISP_E_MEMBERNOTFOUND;
}
@@ -522,7 +524,7 @@ static const IDispatchVtbl IHbOleServer_Vtbl = {
/* IClassFactory object
*/
#if !defined( HB_OLE_C_API )
#if ! defined( HB_OLE_C_API )
typedef struct
{
HRESULT ( STDMETHODCALLTYPE * QueryInterface ) ( IClassFactory*, REFIID, void** );
@@ -533,21 +535,22 @@ typedef struct
} IClassFactoryVtbl;
#endif
typedef struct {
const IClassFactoryVtbl* lpVtbl;
typedef struct
{
const IClassFactoryVtbl * lpVtbl;
} IHbClassFactory;
static IHbClassFactory s_IClassFactoryObj;
static HRESULT STDMETHODCALLTYPE classQueryInterface( IClassFactory* lpThis,
static HRESULT STDMETHODCALLTYPE classQueryInterface( IClassFactory * lpThis,
REFIID riid,
void** ppRet )
void ** ppRet )
{
if( IsEqualIID( riid, HB_ID_REF( IID_IUnknown ) ) ||
IsEqualIID( riid, HB_ID_REF( IID_IClassFactory ) ) )
{
*ppRet = ( void* ) lpThis;
*ppRet = ( void * ) lpThis;
HB_VTBL( lpThis )->AddRef( HB_THIS( lpThis ) );
return S_OK;
}
@@ -555,7 +558,7 @@ static HRESULT STDMETHODCALLTYPE classQueryInterface( IClassFactory* lpThis,
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE classAddRef( IClassFactory* lpThis )
static ULONG STDMETHODCALLTYPE classAddRef( IClassFactory * lpThis )
{
HB_SYMBOL_UNUSED( lpThis );
@@ -563,20 +566,20 @@ static ULONG STDMETHODCALLTYPE classAddRef( IClassFactory* lpThis )
return 1;
}
static ULONG STDMETHODCALLTYPE classRelease( IClassFactory* lpThis )
static ULONG STDMETHODCALLTYPE classRelease( IClassFactory * lpThis )
{
HB_SYMBOL_UNUSED( lpThis );
return InterlockedDecrement( &s_lObjectCount );
}
static HRESULT s_createHbOleObject( REFIID riid, void** ppvObj,
static HRESULT s_createHbOleObject( REFIID riid, void ** ppvObj,
PHB_ITEM pAction, HB_BOOL fGuids )
{
HRESULT hr;
IHbOleServer * thisobj = ( IHbOleServer * ) hb_xalloc( sizeof( IHbOleServer ) );
if( !thisobj )
if( ! thisobj )
{
if( pAction )
hb_itemRelease( pAction );
@@ -591,8 +594,8 @@ static HRESULT s_createHbOleObject( REFIID riid, void** ppvObj,
thisobj->pAction = pAction;
thisobj->fGuids = fGuids;
hr = IHbOleServer_Vtbl.QueryInterface( ( IDispatch* ) thisobj, riid, ppvObj );
IHbOleServer_Vtbl.Release( ( IDispatch* ) thisobj );
hr = IHbOleServer_Vtbl.QueryInterface( ( IDispatch * ) thisobj, riid, ppvObj );
IHbOleServer_Vtbl.Release( ( IDispatch * ) thisobj );
}
return hr;
}
@@ -613,10 +616,10 @@ static HB_BOOL s_objItemToVariant( VARIANT * pVariant, PHB_ITEM pItem )
return HB_FALSE;
}
static HRESULT STDMETHODCALLTYPE classCreateInstance( IClassFactory* lpThis,
IUnknown* punkOuter,
static HRESULT STDMETHODCALLTYPE classCreateInstance( IClassFactory * lpThis,
IUnknown * punkOuter,
REFIID riid,
void** ppvObj )
void ** ppvObj )
{
HRESULT hr;
@@ -648,7 +651,7 @@ static HRESULT STDMETHODCALLTYPE classCreateInstance( IClassFactory* lpThis,
{
if( s_fHashClone )
pAction = hb_itemClone( s_pAction );
else if( !s_pMsgHash && s_hashWithNumKeys( s_pAction ) )
else if( ! s_pMsgHash && s_hashWithNumKeys( s_pAction ) )
fGuids = HB_TRUE;
}
}
@@ -657,7 +660,7 @@ static HRESULT STDMETHODCALLTYPE classCreateInstance( IClassFactory* lpThis,
return hr;
}
static HRESULT STDMETHODCALLTYPE classLockServer( IClassFactory* lpThis,
static HRESULT STDMETHODCALLTYPE classLockServer( IClassFactory * lpThis,
BOOL fLock )
{
HB_SYMBOL_UNUSED( lpThis );
@@ -681,13 +684,13 @@ static const IClassFactoryVtbl IClassFactory_Vtbl = {
/* OLE InProc DLL server API
*/
STDAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void** ppv )
STDAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void ** ppv )
{
HRESULT hr;
HRESULT hr;
if( IsEqualCLSID( rclsid, HB_ID_REF( s_IID_IHbOleServer ) ) )
{
hr = classQueryInterface( ( IClassFactory* ) ( void * ) &s_IClassFactoryObj, riid, ppv );
hr = classQueryInterface( ( IClassFactory * ) ( void * ) &s_IClassFactoryObj, riid, ppv );
}
else
{
@@ -795,13 +798,13 @@ BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, PVOID pvReserved )
DisableThreadLibraryCalls( ( HMODULE ) hInstance );
s_fInit = !hb_vmIsActive();
s_fInit = ! hb_vmIsActive();
if( s_fInit )
hb_vmInit( HB_FALSE );
hb_oleInit();
if( !s_fServerReady )
if( ! s_fServerReady )
{
PHB_DYNS pDynSym = hb_dynsymFind( "DLLMAIN" );
@@ -848,7 +851,7 @@ HB_FUNC( WIN_OLESERVERINIT )
{
HB_ERRCODE errCode = 0;
if( !s_fServerReady )
if( ! s_fServerReady )
{
const char * pszClsId, * pszClsName;
@@ -872,7 +875,7 @@ HB_FUNC( WIN_OLESERVERINIT )
}
pAction = hb_param( 3, HB_IT_HASH | HB_IT_BLOCK | HB_IT_SYMBOL );
if( !pAction && HB_ISOBJECT( 3 ) )
if( ! pAction && HB_ISOBJECT( 3 ) )
pAction = hb_param( 3, HB_IT_OBJECT );
if( pAction )
{
@@ -893,10 +896,10 @@ HB_FUNC( WIN_OLESERVERINIT )
}
}
}
else if( !HB_ISNIL( 4 ) )
else if( ! HB_ISNIL( 4 ) )
errCode = 1001;
}
else if( !HB_ISNIL( 3 ) )
else if( ! HB_ISNIL( 3 ) )
errCode = 1001;
hb_strncpy( s_szClsId, pszClsId, sizeof( s_szClsId ) - 1 );

View File

@@ -112,24 +112,24 @@
#define hbwapi_ret_COLORREF( cr ) ( hb_retnint( cr ) )
#if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \
defined( __DMC__ ) ) && !defined( HB_ARCH_64BIT )
defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT )
# ifndef GetWindowLongPtr
# define GetWindowLongPtr GetWindowLong
# define GetWindowLongPtr GetWindowLong
# endif
# ifndef SetWindowLongPtr
# define SetWindowLongPtr SetWindowLong
# define SetWindowLongPtr SetWindowLong
# endif
# ifndef GWLP_USERDATA
# define GWLP_USERDATA GWL_USERDATA
# define GWLP_USERDATA GWL_USERDATA
# endif
#endif
#if defined( __BORLANDC__ )
# define HBWAPI_GET_LARGEUINT( v ) ( ( HB_MAXUINT ) (v).u.LowPart | \
( ( HB_MAXUINT ) (v).u.HighPart << 32 ) )
# define HBWAPI_GET_LARGEUINT( v ) ( ( HB_MAXUINT ) ( v ).u.LowPart | \
( ( HB_MAXUINT ) ( v ).u.HighPart << 32 ) )
#else
# define HBWAPI_GET_LARGEUINT( v ) ( ( HB_MAXUINT ) (v).LowPart | \
( ( HB_MAXUINT ) (v).HighPart << 32 ) )
# define HBWAPI_GET_LARGEUINT( v ) ( ( HB_MAXUINT ) ( v ).LowPart | \
( ( HB_MAXUINT ) ( v ).HighPart << 32 ) )
#endif
HB_EXTERN_BEGIN

View File

@@ -61,35 +61,35 @@
#include <windows.h>
#define HB_WIN_COM_FUN_CREATEFILE 1
#define HB_WIN_COM_FUN_GETCOMMSTATE 2
#define HB_WIN_COM_FUN_SETCOMMSTATE 3
#define HB_WIN_COM_FUN_SETUPCOMM 4
#define HB_WIN_COM_FUN_GETCOMMTIMEOUTS 5
#define HB_WIN_COM_FUN_SETCOMMTIMEOUTS 6
#define HB_WIN_COM_FUN_CLOSEHANDLE 7
#define HB_WIN_COM_FUN_WRITEFILE 8
#define HB_WIN_COM_FUN_READFILE 9
#define HB_WIN_COM_FUN_GETCOMMMODEMSTATUS 10 /* win_com:Status() */
#define HB_WIN_COM_FUN_PURGECOMM 11
#define HB_WIN_COM_FUN_CLEARCOMMERROR 12 /* win_com:QueueStatus() */
#define HB_WIN_COM_FUN_ESCAPECOMMFUNCTION 13
#define HB_WIN_COM_FUN_GETCOMMPROPERTIES 14
#define HB_WIN_COM_FUN_MAX 14
#define HB_WIN_COM_FUN_CREATEFILE 1
#define HB_WIN_COM_FUN_GETCOMMSTATE 2
#define HB_WIN_COM_FUN_SETCOMMSTATE 3
#define HB_WIN_COM_FUN_SETUPCOMM 4
#define HB_WIN_COM_FUN_GETCOMMTIMEOUTS 5
#define HB_WIN_COM_FUN_SETCOMMTIMEOUTS 6
#define HB_WIN_COM_FUN_CLOSEHANDLE 7
#define HB_WIN_COM_FUN_WRITEFILE 8
#define HB_WIN_COM_FUN_READFILE 9
#define HB_WIN_COM_FUN_GETCOMMMODEMSTATUS 10 /* win_com:Status() */
#define HB_WIN_COM_FUN_PURGECOMM 11
#define HB_WIN_COM_FUN_CLEARCOMMERROR 12 /* win_com:QueueStatus() */
#define HB_WIN_COM_FUN_ESCAPECOMMFUNCTION 13
#define HB_WIN_COM_FUN_GETCOMMPROPERTIES 14
#define HB_WIN_COM_FUN_MAX 14
#define HB_WIN_COM_DBGBASIC 0x01
#define HB_WIN_COM_DBGFLOW 0x02
#define HB_WIN_COM_DBGXTRAFLOW 0x04
#define HB_WIN_COM_DBGOTHER 0x08
#define HB_WIN_COM_DBGTIMEOUTS 0x10
#define HB_WIN_COM_DBGQUEUE 0x20
#define HB_WIN_COM_DBGALL 0x3F
#define HB_WIN_COM_DBGBASIC 0x01
#define HB_WIN_COM_DBGFLOW 0x02
#define HB_WIN_COM_DBGXTRAFLOW 0x04
#define HB_WIN_COM_DBGOTHER 0x08
#define HB_WIN_COM_DBGTIMEOUTS 0x10
#define HB_WIN_COM_DBGQUEUE 0x20
#define HB_WIN_COM_DBGALL 0x3F
/* hbwin_bitmapType() return values */
#define HB_WIN_BITMAP_UNKNOWN 0
#define HB_WIN_BITMAP_BMP 1
#define HB_WIN_BITMAP_JPEG 2
#define HB_WIN_BITMAP_PNG 3
#define HB_WIN_BITMAP_UNKNOWN 0
#define HB_WIN_BITMAP_BMP 1
#define HB_WIN_BITMAP_JPEG 2
#define HB_WIN_BITMAP_PNG 3
HB_EXTERN_BEGIN

View File

@@ -77,8 +77,8 @@
* compilers where nameless unions are default
*/
#if defined( __BORLANDC__ ) || \
( defined( __WATCOMC__ ) && !defined( __cplusplus ) )
# if !defined( NONAMELESSUNION )
( defined( __WATCOMC__ ) && ! defined( __cplusplus ) )
# if ! defined( NONAMELESSUNION )
# define NONAMELESSUNION
# endif
#endif
@@ -90,39 +90,39 @@
/* MinGW is lacking a number of variant accessors
*/
#if defined( __MINGW32__ )
# if !defined( V_I1REF )
# define V_I1REF( x ) V_UNION( x, pcVal )
# if ! defined( V_I1REF )
# define V_I1REF( x ) V_UNION( x, pcVal )
# endif
# if !defined( V_UI2REF )
# define V_UI2REF( x ) V_UNION( x, puiVal )
# if ! defined( V_UI2REF )
# define V_UI2REF( x ) V_UNION( x, puiVal )
# endif
# if !defined( V_INT )
# define V_INT( x ) V_UNION( x, intVal )
# if ! defined( V_INT )
# define V_INT( x ) V_UNION( x, intVal )
# endif
# if !defined( V_INTREF )
# define V_INTREF( x ) V_UNION( x, pintVal )
# if ! defined( V_INTREF )
# define V_INTREF( x ) V_UNION( x, pintVal )
# endif
# if !defined( V_UINT )
# define V_UINT( x ) V_UNION( x, uintVal )
# if ! defined( V_UINT )
# define V_UINT( x ) V_UNION( x, uintVal )
# endif
# if !defined( V_UINTREF )
# define V_UINTREF( x ) V_UNION( x, puintVal )
# if ! defined( V_UINTREF )
# define V_UINTREF( x ) V_UNION( x, puintVal )
# endif
#endif
#if defined( NONAMELESSUNION )
# define HB_WIN_U1( x, y ) ( x )->n1.y
# define HB_WIN_U2( x, y ) ( x )->n1.n2.y
# define HB_WIN_U3( x, y ) ( x )->n1.n2.n3.y
# define HB_WIN_U1( x, y ) ( x )->n1.y
# define HB_WIN_U2( x, y ) ( x )->n1.n2.y
# define HB_WIN_U3( x, y ) ( x )->n1.n2.n3.y
#else
# define HB_WIN_U1( x, y ) ( x )->y
# define HB_WIN_U2( x, y ) ( x )->y
# define HB_WIN_U3( x, y ) ( x )->y
# define HB_WIN_U1( x, y ) ( x )->y
# define HB_WIN_U2( x, y ) ( x )->y
# define HB_WIN_U3( x, y ) ( x )->y
#endif
/* macros used to hide type of interface: C or C++
*/
#if defined( __cplusplus ) && !defined( CINTERFACE ) && \
#if defined( __cplusplus ) && ! defined( CINTERFACE ) && \
( defined( __BORLANDC__ ) || \
defined( __DMC__ ) || \
defined( _MSC_VER ) || \
@@ -142,34 +142,34 @@
HB_EXTERN_BEGIN
typedef HB_BOOL ( * HB_OLEOBJ_FUNC )( VARIANT*, PHB_ITEM );
typedef void ( * HB_OLE_DESTRUCTOR_FUNC )( void * );
typedef HB_BOOL ( *HB_OLEOBJ_FUNC )( VARIANT *, PHB_ITEM );
typedef void ( *HB_OLE_DESTRUCTOR_FUNC )( void * );
extern HB_EXPORT HB_BOOL hb_oleInit( void );
extern HB_EXPORT HRESULT hb_oleGetError( void );
extern HB_EXPORT void hb_oleSetError( HRESULT lOleError );
extern HB_EXPORT void hb_oleDispatchToItem( PHB_ITEM pItem, IDispatch * pdispVal, HB_USHORT uiClass );
extern HB_EXPORT IDispatch* hb_oleItemGetDispatch( PHB_ITEM pItem );
extern HB_EXPORT void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT * pVariant );
extern HB_EXPORT void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass );
extern HB_EXPORT void hb_oleItemToVariant( VARIANT * pVariant, PHB_ITEM pItem );
extern HB_EXPORT void hb_oleItemToVariantEx( VARIANT * pVariant, PHB_ITEM pItem, HB_OLEOBJ_FUNC pObjFunc );
extern HB_EXPORT void hb_oleVariantUpdate( VARIANT * pVariant, PHB_ITEM pItem, HB_OLEOBJ_FUNC pObjFunc );
extern HB_EXPORT VARIANT * hb_oleItemGetVariant( PHB_ITEM pItem );
extern HB_EXPORT PHB_ITEM hb_oleItemPutVariant( PHB_ITEM pItem, VARIANT * pVariant, HB_BOOL fMove );
extern HB_EXPORT IDispatch* hb_oleParam( int iParam );
extern HB_EXPORT IDispatch* hb_oleItemGet( PHB_ITEM pItem );
extern HB_EXPORT PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch * pDisp );
extern HB_EXPORT PHB_ITEM hb_oleItemGetCallBack( PHB_ITEM pItem );
extern HB_EXPORT void hb_oleItemSetCallBack( PHB_ITEM pItem, PHB_ITEM * pCallBack );
extern HB_EXPORT HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
extern HB_EXPORT HB_BOOL hb_oleInit( void );
extern HB_EXPORT HRESULT hb_oleGetError( void );
extern HB_EXPORT void hb_oleSetError( HRESULT lOleError );
extern HB_EXPORT void hb_oleDispatchToItem( PHB_ITEM pItem, IDispatch * pdispVal, HB_USHORT uiClass );
extern HB_EXPORT IDispatch * hb_oleItemGetDispatch( PHB_ITEM pItem );
extern HB_EXPORT void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT * pVariant );
extern HB_EXPORT void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT * pVariant, HB_USHORT uiClass );
extern HB_EXPORT void hb_oleItemToVariant( VARIANT * pVariant, PHB_ITEM pItem );
extern HB_EXPORT void hb_oleItemToVariantEx( VARIANT * pVariant, PHB_ITEM pItem, HB_OLEOBJ_FUNC pObjFunc );
extern HB_EXPORT void hb_oleVariantUpdate( VARIANT * pVariant, PHB_ITEM pItem, HB_OLEOBJ_FUNC pObjFunc );
extern HB_EXPORT VARIANT * hb_oleItemGetVariant( PHB_ITEM pItem );
extern HB_EXPORT PHB_ITEM hb_oleItemPutVariant( PHB_ITEM pItem, VARIANT * pVariant, HB_BOOL fMove );
extern HB_EXPORT IDispatch * hb_oleParam( int iParam );
extern HB_EXPORT IDispatch * hb_oleItemGet( PHB_ITEM pItem );
extern HB_EXPORT PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch * pDisp );
extern HB_EXPORT PHB_ITEM hb_oleItemGetCallBack( PHB_ITEM pItem );
extern HB_EXPORT void hb_oleItemSetCallBack( PHB_ITEM pItem, PHB_ITEM * pCallBack );
extern HB_EXPORT HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
DISPPARAMS * pParams, VARIANT * pVarResult,
HB_OLEOBJ_FUNC pObjFunc, HB_USHORT uiClass );
extern HB_EXPORT void hb_oleItemSetDestructor( PHB_ITEM pItem, HB_OLE_DESTRUCTOR_FUNC pFunc, void * cargo );
extern HB_EXPORT void hb_oleItemSetDestructor( PHB_ITEM pItem, HB_OLE_DESTRUCTOR_FUNC pFunc, void * cargo );
/* activex control */
extern HB_EXPORT HB_BOOL hb_oleAxInit( void );
extern HB_EXPORT PHB_ITEM hb_oleAxControlNew( PHB_ITEM pItem, HWND hWnd );
extern HB_EXPORT HB_BOOL hb_oleAxInit( void );
extern HB_EXPORT PHB_ITEM hb_oleAxControlNew( PHB_ITEM pItem, HWND hWnd );
HB_EXTERN_END

View File

@@ -70,16 +70,16 @@
#include <mapi.h>
#if !defined( MAPI_RECEIPT_REQUESTED )
#if ! defined( MAPI_RECEIPT_REQUESTED )
# if defined( MAPI_RECIPIENT_REQUESTED )
# define MAPI_RECEIPT_REQUESTED MAPI_RECIPIENT_REQUESTED
# define MAPI_RECEIPT_REQUESTED MAPI_RECIPIENT_REQUESTED
# else
# define MAPI_RECEIPT_REQUESTED 0x00000002L
# define MAPI_RECEIPT_REQUESTED 0x00000002L
# endif
#endif
#if defined( __WATCOMC__ ) || defined( __CYGWIN__ )
typedef ULONG ( PASCAL * LPMAPISENDMAIL ) ( LHANDLE, ULONG, lpMapiMessage, FLAGS, ULONG );
typedef ULONG ( PASCAL * LPMAPISENDMAIL )( LHANDLE, ULONG, lpMapiMessage, FLAGS, ULONG );
#endif
HB_FUNC( WIN_MAPISENDMAIL )
@@ -91,17 +91,17 @@ HB_FUNC( WIN_MAPISENDMAIL )
if( ( hMapiDll = hbwapi_LoadLibrarySystem(
#if defined( HB_UNICODE_ORI ) || defined( UNICODE )
( LPCTSTR ) L"mapi32.dll"
( LPCTSTR ) L"mapi32.dll"
#else
( LPCTSTR ) "mapi32.dll"
( LPCTSTR ) "mapi32.dll"
#endif
) ) >= ( HINSTANCE ) 32 )
) ) >= ( HINSTANCE ) 32 )
{
LPMAPISENDMAIL MAPISendMail = ( LPMAPISENDMAIL ) GetProcAddress( hMapiDll, "MAPISendMail" );
if( MAPISendMail )
{
PHB_ITEM pFrom = hb_param( 8, HB_IT_ARRAY );
PHB_ITEM pFrom = hb_param( 8, HB_IT_ARRAY );
PHB_ITEM pRecpList = hb_param( 9, HB_IT_ARRAY );
PHB_ITEM pFileList = hb_param( 10, HB_IT_ARRAY );
@@ -110,11 +110,11 @@ HB_FUNC( WIN_MAPISENDMAIL )
HB_SIZE i;
void ** hString;
int iString = 0;
int iString = 0;
MapiMessage note;
MapiMessage note;
MapiRecipDesc origin;
FLAGS flags;
FLAGS flags;
memset( &note, 0, sizeof( note ) );
memset( &origin, 0, sizeof( origin ) );
@@ -135,7 +135,7 @@ HB_FUNC( WIN_MAPISENDMAIL )
if( nFileCount )
{
note.lpFiles = ( MapiFileDesc * ) hb_xgrab( nFileCount * sizeof( MapiFileDesc ) );
memset( note.lpFiles , 0, nFileCount * sizeof( MapiFileDesc ) );
memset( note.lpFiles, 0, nFileCount * sizeof( MapiFileDesc ) );
}
if( hb_parl( 6 ) )
@@ -189,7 +189,7 @@ HB_FUNC( WIN_MAPISENDMAIL )
}
else if( HB_IS_STRING( pItem ) )
{
note.lpRecips[ note.nRecipCount ].lpszName = ( LPSTR ) HB_ITEMGETSTR( pItem, &hString[ iString++ ], NULL );
note.lpRecips[ note.nRecipCount ].lpszName = ( LPSTR ) HB_ITEMGETSTR( pItem, &hString[ iString++ ], NULL );
note.lpRecips[ note.nRecipCount ].ulRecipClass = MAPI_TO;
++note.nRecipCount;

View File

@@ -59,22 +59,22 @@
/* enable workaround for wrong OLE variant structure definition */
#if ( defined( __POCC__ ) && defined( HB_OS_WIN_CE ) ) || \
defined( __DMC__ ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
defined( __DMC__ ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
# define HB_OLE_NO_LL
#endif
#if ( defined( __POCC__ ) && defined( HB_OS_WIN_CE ) ) || \
( defined( __WATCOMC__ ) && ( __WATCOMC__ < 1280 ) ) || \
defined( __MINGW32__ ) || \
defined( __DMC__ ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
( defined( __WATCOMC__ ) && ( __WATCOMC__ < 1280 ) ) || \
defined( __MINGW32__ ) || \
defined( __DMC__ ) || \
( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
# define HB_OLE_NO_LLREF
#endif
/* base date value in OLE (1899-12-30) as julian day */
#define HB_OLE_DATE_BASE 0x0024D9AB
#define HB_OLE_DATE_BASE 0x0024D9AB
static PHB_DYNS s_pDyns_hb_oleauto;
static PHB_DYNS s_pDyns_hObjAccess;
@@ -82,16 +82,16 @@ static PHB_DYNS s_pDyns_hObjAssign;
typedef struct
{
IDispatch* pDisp;
PHB_ITEM* pCallBack;
IDispatch * pDisp;
PHB_ITEM * pCallBack;
HB_OLE_DESTRUCTOR_FUNC pDestructorFunc;
void * cargo;
void * cargo;
} HB_OLE;
typedef struct
{
HRESULT lOleError;
int iInit;
HRESULT lOleError;
int iInit;
} HB_OLEDATA, * PHB_OLEDATA;
static void hb_oleDataInit( void * cargo )
@@ -121,7 +121,7 @@ static void hb_oleDataRelease( void * cargo )
}
static HB_TSD_NEW( s_oleData, sizeof( HB_OLEDATA ), hb_oleDataInit, hb_oleDataRelease );
#define hb_getOleData() ( ( PHB_OLEDATA ) hb_stackGetTSD( &s_oleData ) )
#define hb_getOleData() ( ( PHB_OLEDATA ) hb_stackGetTSD( &s_oleData ) )
HB_FUNC_EXTERN( WIN_OLEAUTO );
@@ -143,7 +143,7 @@ HRESULT hb_oleGetError( void )
}
static void hb_olecore_init( void* cargo )
static void hb_olecore_init( void * cargo )
{
HB_SYMBOL_UNUSED( cargo );
@@ -234,12 +234,13 @@ static const HB_GC_FUNCS s_gcVariantFuncs =
static void hb_errRT_OLE( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, HB_ERRCODE errOsCode, const char * szDescription, const char * szOperation, const char * szFileName )
{
PHB_ITEM pError;
pError = hb_errRT_New( ES_ERROR, "WINOLE", errGenCode, errSubCode, szDescription, szOperation, errOsCode, EF_NONE );
if( hb_pcount() != 0 )
{
/* HB_ERR_ARGS_BASEPARAMS */
PHB_ITEM pArray = hb_arrayBaseParams();
PHB_ITEM pArray = hb_arrayBaseParams();
hb_errPutArgsArray( pError, pArray );
hb_itemRelease( pArray );
}
@@ -255,7 +256,7 @@ static void hb_errRT_OLE( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, HB_ERRCO
static void hb_oleExcepDescription( EXCEPINFO * pExcep, char ** pszDescription, char ** pszSource )
{
if( pExcep->pfnDeferredFillIn )
( * pExcep->pfnDeferredFillIn )( pExcep );
( *pExcep->pfnDeferredFillIn )( pExcep );
if( pExcep->bstrSource )
{
@@ -283,18 +284,18 @@ static void hb_oleExcepDescription( EXCEPINFO * pExcep, char ** pszDescription,
}
else
{
* pszDescription = ( char * ) hb_xgrab( ( 14 + 1 ) * sizeof( char ) );
( * pszDescription )[ 0 ] = '\0';
*pszDescription = ( char * ) hb_xgrab( ( 14 + 1 ) * sizeof( char ) );
( *pszDescription )[ 0 ] = '\0';
}
if( pExcep->wCode )
hb_snprintf( ( * pszDescription ) + strlen( * pszDescription ), 14, " (%d)", pExcep->wCode);
hb_snprintf( ( *pszDescription ) + strlen( *pszDescription ), 14, " (%d)", pExcep->wCode );
else
hb_snprintf( ( * pszDescription ) + strlen( * pszDescription ), 14, " (0x%08lX)", pExcep->scode);
hb_snprintf( ( *pszDescription ) + strlen( *pszDescription ), 14, " (0x%08lX)", pExcep->scode );
}
IDispatch* hb_oleParam( int iParam )
IDispatch * hb_oleParam( int iParam )
{
HB_OLE * pOle = ( HB_OLE * ) hb_parptrGC( &s_gcOleFuncs, iParam );
@@ -306,14 +307,15 @@ IDispatch* hb_oleParam( int iParam )
}
IDispatch* hb_oleItemGet( PHB_ITEM pItem )
IDispatch * hb_oleItemGet( PHB_ITEM pItem )
{
HB_OLE * pOle = ( HB_OLE * ) hb_itemGetPtrGC( pItem, &s_gcOleFuncs );
return pOle ? pOle->pDisp : NULL;
}
PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch* pDisp )
PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch * pDisp )
{
HB_OLE * pOle = ( HB_OLE * ) hb_gcAllocate( sizeof( HB_OLE ), &s_gcOleFuncs );
@@ -328,11 +330,12 @@ PHB_ITEM hb_oleItemPut( PHB_ITEM pItem, IDispatch* pDisp )
PHB_ITEM hb_oleItemGetCallBack( PHB_ITEM pItem )
{
HB_OLE * pOle = ( HB_OLE * ) hb_itemGetPtrGC( pItem, &s_gcOleFuncs );
return pOle && pOle->pCallBack ? *pOle->pCallBack : NULL;
}
void hb_oleItemSetCallBack( PHB_ITEM pItem, PHB_ITEM* pCallBack )
void hb_oleItemSetCallBack( PHB_ITEM pItem, PHB_ITEM * pCallBack )
{
HB_OLE * pOle = ( HB_OLE * ) hb_itemGetPtrGC( pItem, &s_gcOleFuncs );
@@ -366,9 +369,9 @@ void hb_oleItemSetDestructor( PHB_ITEM pItem, HB_OLE_DESTRUCTOR_FUNC pFunc, void
}
static IEnumVARIANT* hb_oleenumParam( int iParam )
static IEnumVARIANT * hb_oleenumParam( int iParam )
{
IEnumVARIANT** ppEnum = ( IEnumVARIANT** ) hb_parptrGC( &s_gcOleenumFuncs, iParam );
IEnumVARIANT ** ppEnum = ( IEnumVARIANT ** ) hb_parptrGC( &s_gcOleenumFuncs, iParam );
if( ppEnum && *ppEnum )
return *ppEnum;
@@ -423,7 +426,7 @@ static VARIANT * hb_oleVariantParam( int iParam )
{
VARIANT * pVariant = ( VARIANT * ) hb_parptrGC( &s_gcVariantFuncs, iParam );
if( !pVariant )
if( ! pVariant )
hb_errRT_OLE( EG_ARG, 1017, 0, NULL, HB_ERR_FUNCNAME, NULL );
return pVariant;
@@ -457,10 +460,10 @@ PHB_ITEM hb_oleItemPutVariant( PHB_ITEM pItem, VARIANT * pVariant, HB_BOOL fMove
/* Unicode string management */
static wchar_t* AnsiToWide( const char* szString )
static wchar_t * AnsiToWide( const char * szString )
{
int iLen;
wchar_t* szWide;
wchar_t * szWide;
iLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szString, -1, NULL, 0 );
szWide = ( wchar_t* ) hb_xgrab( iLen * sizeof( wchar_t ) );
@@ -468,7 +471,7 @@ static wchar_t* AnsiToWide( const char* szString )
return szWide;
}
static void AnsiToWideBuffer( const char* szString, wchar_t* szWide, int iLen )
static void AnsiToWideBuffer( const char * szString, wchar_t * szWide, int iLen )
{
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szString, -1, szWide, iLen );
szWide[ iLen - 1 ] = L'\0';
@@ -509,8 +512,8 @@ IDispatch * hb_oleItemGetDispatch( PHB_ITEM pItem )
}
static void hb_oleDispatchToVariant( VARIANT* pVariant, IDispatch* pDisp,
VARIANT* pVarRef )
static void hb_oleDispatchToVariant( VARIANT * pVariant, IDispatch * pDisp,
VARIANT * pVarRef )
{
/* pVariant will be freed using VariantClear().
We increment reference count to keep OLE object alive */
@@ -527,8 +530,8 @@ static void hb_oleDispatchToVariant( VARIANT* pVariant, IDispatch* pDisp,
/* Item <-> Variant conversion */
static void hb_oleItemToVariantRef( VARIANT* pVariant, PHB_ITEM pItem,
VARIANT* pVarRef, HB_OLEOBJ_FUNC pObjFunc )
static void hb_oleItemToVariantRef( VARIANT * pVariant, PHB_ITEM pItem,
VARIANT * pVarRef, HB_OLEOBJ_FUNC pObjFunc )
{
VariantClear( pVariant ); /* VT_T( pVariant ) = VT_EMPTY; */
@@ -669,9 +672,9 @@ static void hb_oleItemToVariantRef( VARIANT* pVariant, PHB_ITEM pItem,
}
else
{
SAFEARRAY* pSafeArray;
SAFEARRAYBOUND sabound[ 1 ];
HB_SIZE n, nLen;
SAFEARRAY * pSafeArray;
SAFEARRAYBOUND sabound[ 1 ];
HB_SIZE n, nLen;
nLen = hb_arrayLen( pItem );
@@ -689,8 +692,8 @@ static void hb_oleItemToVariantRef( VARIANT* pVariant, PHB_ITEM pItem,
for( n = 0; n < nLen; n++ )
{
VARIANT vItem;
long lIndex[ 1 ];
VARIANT vItem;
long lIndex[ 1 ];
VariantInit( &vItem );
hb_oleItemToVariantRef( &vItem, hb_arrayGetItemPtr( pItem, n + 1 ), NULL, pObjFunc );
@@ -723,13 +726,13 @@ static void hb_oleItemToVariantRef( VARIANT* pVariant, PHB_ITEM pItem,
}
void hb_oleItemToVariant( VARIANT* pVariant, PHB_ITEM pItem )
void hb_oleItemToVariant( VARIANT * pVariant, PHB_ITEM pItem )
{
hb_oleItemToVariantRef( pVariant, pItem, NULL, NULL );
}
void hb_oleItemToVariantEx( VARIANT* pVariant, PHB_ITEM pItem,
void hb_oleItemToVariantEx( VARIANT * pVariant, PHB_ITEM pItem,
HB_OLEOBJ_FUNC pObjFunc )
{
hb_oleItemToVariantRef( pVariant, pItem, NULL, pObjFunc );
@@ -791,7 +794,7 @@ static void hb_oleSafeArrayToItem( PHB_ITEM pItem, SAFEARRAY * pSafeArray,
}
void hb_oleDispatchToItem( PHB_ITEM pItem, IDispatch* pdispVal, HB_USHORT uiClass )
void hb_oleDispatchToItem( PHB_ITEM pItem, IDispatch * pdispVal, HB_USHORT uiClass )
{
if( pdispVal )
{
@@ -830,7 +833,7 @@ void hb_oleDispatchToItem( PHB_ITEM pItem, IDispatch* pdispVal, HB_USHORT uiClas
}
}
void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass )
void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT * pVariant, HB_USHORT uiClass )
{
if( V_VT( pVariant ) == ( VT_VARIANT | VT_BYREF ) )
pVariant = V_VARIANTREF( pVariant );
@@ -840,14 +843,14 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
case VT_UNKNOWN:
case VT_UNKNOWN | VT_BYREF:
{
IDispatch* pdispVal = NULL;
IUnknown* punkVal = V_VT( pVariant ) == VT_UNKNOWN ?
V_UNKNOWN( pVariant ) :
*V_UNKNOWNREF( pVariant );
IDispatch * pdispVal = NULL;
IUnknown * punkVal = V_VT( pVariant ) == VT_UNKNOWN ?
V_UNKNOWN( pVariant ) :
*V_UNKNOWNREF( pVariant );
hb_itemClear( pItem );
if( punkVal && HB_VTBL( punkVal )->QueryInterface(
HB_THIS_( punkVal ) HB_ID_REF( IID_IDispatch ),
( void** ) ( void * ) &pdispVal ) == S_OK )
HB_THIS_( punkVal ) HB_ID_REF( IID_IDispatch ),
( void ** ) ( void * ) &pdispVal ) == S_OK )
{
hb_oleDispatchToItem( pItem, pdispVal, uiClass );
HB_VTBL( pdispVal )->Release( HB_THIS( pdispVal ) );
@@ -884,7 +887,7 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
break;
case VT_I1 | VT_BYREF:
hb_itemPutNI( pItem, ( signed char ) * V_I1REF( pVariant ) );
hb_itemPutNI( pItem, ( signed char ) *V_I1REF( pVariant ) );
break;
case VT_I2:
@@ -908,7 +911,7 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
hb_itemPutNInt( pItem, ( HB_MAXINT ) V_I4( pVariant ) );
#elif defined( HB_OLE_NO_LL )
/* workaround for wrong OLE variant structure definition */
hb_itemPutNInt( pItem, * ( ( HB_LONGLONG * ) &V_I4( pVariant ) ) );
hb_itemPutNInt( pItem, *( ( HB_LONGLONG * ) &V_I4( pVariant ) ) );
#else
hb_itemPutNInt( pItem, V_I8( pVariant ) );
#endif
@@ -919,7 +922,7 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
hb_itemPutNInt( pItem, ( HB_MAXINT ) *V_I4REF( pVariant ) );
#elif defined( HB_OLE_NO_LLREF )
/* workaround for wrong OLE variant structure definition */
hb_itemPutNInt( pItem, * ( HB_LONGLONG * ) V_R8REF( pVariant ) );
hb_itemPutNInt( pItem, *( HB_LONGLONG * ) V_R8REF( pVariant ) );
#else
hb_itemPutNInt( pItem, *V_I8REF( pVariant ) );
#endif
@@ -955,7 +958,7 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
hb_itemPutNInt( pItem, ( HB_MAXINT ) V_UI4( pVariant ) );
#elif defined( HB_OLE_NO_LL )
/* workaround for wrong OLE variant structure definition */
hb_itemPutNInt( pItem, * ( ( HB_LONGLONG * ) &V_UI4( pVariant ) ) );
hb_itemPutNInt( pItem, *( ( HB_LONGLONG * ) &V_UI4( pVariant ) ) );
#else
hb_itemPutNInt( pItem, ( HB_MAXINT ) V_UI8( pVariant ) );
#endif
@@ -967,7 +970,7 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
hb_itemPutNInt( pItem, ( HB_MAXINT ) *V_UI4REF( pVariant ) );
#elif defined( HB_OLE_NO_LLREF )
/* workaround for wrong OLE variant structure definition */
hb_itemPutNInt( pItem, * ( HB_LONGLONG * ) V_R8REF( pVariant ) );
hb_itemPutNInt( pItem, *( HB_LONGLONG * ) V_R8REF( pVariant ) );
#else
hb_itemPutNInt( pItem, ( HB_MAXINT ) *V_UI8REF( pVariant ) );
#endif
@@ -1075,11 +1078,11 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
V_ARRAY( pVariant );
if( pSafeArray )
{
int iDim = ( int ) SafeArrayGetDim( pSafeArray );
int iDim = ( int ) SafeArrayGetDim( pSafeArray );
if( iDim >= 1 )
{
if( iDim > 1 || !hb_oleSafeArrayToString( pItem, pSafeArray ) )
if( iDim > 1 || ! hb_oleSafeArrayToString( pItem, pSafeArray ) )
{
long * plIndex = ( long * ) hb_xgrab( iDim * sizeof( long ) );
@@ -1100,13 +1103,13 @@ void hb_oleVariantToItemEx( PHB_ITEM pItem, VARIANT* pVariant, HB_USHORT uiClass
}
void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant )
void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT * pVariant )
{
hb_oleVariantToItemEx( pItem, pVariant, 0 );
}
void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
void hb_oleVariantUpdate( VARIANT * pVariant, PHB_ITEM pItem,
HB_OLEOBJ_FUNC pObjFunc )
{
switch( V_VT( pVariant ) )
@@ -1117,7 +1120,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
if( pDisp )
{
IDispatch* pdispVal = *V_DISPATCHREF( pVariant );
IDispatch * pdispVal = *V_DISPATCHREF( pVariant );
if( pdispVal != pDisp )
{
HB_VTBL( pDisp )->AddRef( HB_THIS( pDisp ) );
@@ -1132,7 +1135,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
VariantInit( &variant );
if( pObjFunc( &variant, pItem ) )
{
IDispatch* pdispVal = *V_DISPATCHREF( pVariant );
IDispatch * pdispVal = *V_DISPATCHREF( pVariant );
*V_DISPATCHREF( pVariant ) = V_DISPATCH( &variant );
if( pdispVal )
HB_VTBL( pdispVal )->Release( HB_THIS( pdispVal ) );
@@ -1143,17 +1146,17 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
case VT_UNKNOWN | VT_BYREF:
{
IDispatch* pDisp = hb_oleItemGetDispatch( pItem );
IDispatch * pDisp = hb_oleItemGetDispatch( pItem );
if( pDisp )
{
IUnknown* pUnk = NULL;
IUnknown * pUnk = NULL;
if( HB_VTBL( pDisp )->QueryInterface( HB_THIS_( pDisp )
HB_ID_REF( IID_IEnumVARIANT ),
( void** ) ( void * ) &pUnk ) == S_OK )
HB_ID_REF( IID_IEnumVARIANT ),
( void ** ) ( void * ) &pUnk ) == S_OK )
{
IUnknown* punkVal = *V_UNKNOWNREF( pVariant );
IUnknown * punkVal = *V_UNKNOWNREF( pVariant );
if( punkVal )
HB_VTBL( punkVal )->Release( HB_THIS( punkVal ) );
*V_UNKNOWNREF( pVariant ) = pUnk;
@@ -1165,7 +1168,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
VariantInit( &variant );
if( pObjFunc( &variant, pItem ) )
{
IDispatch* pdispVal = *V_DISPATCHREF( pVariant );
IDispatch * pdispVal = *V_DISPATCHREF( pVariant );
*V_DISPATCHREF( pVariant ) = V_DISPATCH( &variant );
if( pdispVal )
HB_VTBL( pdispVal )->Release( HB_THIS( pdispVal ) );
@@ -1200,7 +1203,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
*V_I4REF( pVariant ) = ( long ) hb_itemGetNInt( pItem );
#elif defined( HB_OLE_NO_LLREF )
/* workaround for wrong OLE variant structure definition */
* ( HB_LONGLONG * ) V_R8REF( pVariant ) = ( HB_LONGLONG ) hb_itemGetNInt( pItem );
*( HB_LONGLONG * ) V_R8REF( pVariant ) = ( HB_LONGLONG ) hb_itemGetNInt( pItem );
#else
*V_I8REF( pVariant ) = ( HB_LONGLONG ) hb_itemGetNInt( pItem );
#endif
@@ -1223,7 +1226,7 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
*V_UI4REF( pVariant ) = ( unsigned long ) hb_itemGetNInt( pItem );
#elif defined( HB_OLE_NO_LLREF )
/* workaround for wrong OLE variant structure definition */
* ( HB_ULONGLONG * ) V_R8REF( pVariant ) = ( HB_ULONGLONG ) hb_itemGetNInt( pItem );
*( HB_ULONGLONG * ) V_R8REF( pVariant ) = ( HB_ULONGLONG ) hb_itemGetNInt( pItem );
#else
*V_UI8REF( pVariant ) = ( HB_ULONGLONG ) hb_itemGetNInt( pItem );
#endif
@@ -1282,16 +1285,16 @@ void hb_oleVariantUpdate( VARIANT* pVariant, PHB_ITEM pItem,
typedef struct
{
PHB_ITEM item;
VARIANT* variant;
PHB_ITEM item;
VARIANT * variant;
}
HB_OLE_PARAM_REF;
HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
DISPPARAMS* pParams, VARIANT* pVarResult,
DISPPARAMS * pParams, VARIANT * pVarResult,
HB_OLEOBJ_FUNC pObjFunc, HB_USHORT uiClass )
{
if( !pSym && HB_IS_SYMBOL( pObject ) )
if( ! pSym && HB_IS_SYMBOL( pObject ) )
{
pSym = hb_itemGetSymbol( pObject );
pObject = NULL;
@@ -1341,7 +1344,7 @@ HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
&pParams->rgvarg[ iCount - i ], uiClass );
}
if( pObject && !HB_IS_HASH( pObject ) )
if( pObject && ! HB_IS_HASH( pObject ) )
hb_vmSend( ( HB_USHORT ) iParams );
else
hb_vmProc( ( HB_USHORT ) iParams );
@@ -1366,7 +1369,7 @@ HB_BOOL hb_oleDispInvoke( PHB_SYMB pSym, PHB_ITEM pObject, PHB_ITEM pParam,
static void GetParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_BOOL fUseRef )
{
VARIANTARG *pArgs = NULL, *pRefs;
VARIANTARG * pArgs = NULL, * pRefs;
UINT uiArgCount, uiArg, uiRefs;
uiArgCount = ( UINT ) hb_pcount();
@@ -1387,7 +1390,7 @@ static void GetParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_BOOL fUseRef
}
}
pArgs = ( VARIANTARG* ) hb_xgrab( sizeof( VARIANTARG ) * ( uiArgCount + uiRefs ) );
pArgs = ( VARIANTARG * ) hb_xgrab( sizeof( VARIANTARG ) * ( uiArgCount + uiRefs ) );
pRefs = &pArgs[ uiArgCount ];
for( uiArg = 0; uiArg < uiArgCount; uiArg++ )
@@ -1413,7 +1416,7 @@ static void GetParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_BOOL fUseRef
static void PutParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_USHORT uiClass )
{
VARIANTARG* pRefs = &dispparam->rgvarg[ dispparam->cArgs ];
VARIANTARG * pRefs = &dispparam->rgvarg[ dispparam->cArgs ];
PHB_ITEM pItem = NULL;
UINT uiArg;
@@ -1421,7 +1424,7 @@ static void PutParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_USHORT uiCla
{
if( HB_ISBYREF( uiOffset + dispparam->cArgs - uiArg ) )
{
if( !pItem )
if( ! pItem )
pItem = hb_itemNew( NULL );
hb_oleVariantToItemEx( pItem, &dispparam->rgvarg[ uiArg ], uiClass );
hb_itemParamStoreForward( ( HB_USHORT ) ( uiOffset + dispparam->cArgs - uiArg ), pItem );
@@ -1435,7 +1438,7 @@ static void PutParams( DISPPARAMS * dispparam, HB_UINT uiOffset, HB_USHORT uiCla
static void FreeParams( DISPPARAMS * dispparam )
{
UINT ui;
UINT ui;
if( dispparam->cArgs > 0 )
{
@@ -1456,12 +1459,12 @@ HB_FUNC( __OLEISDISP )
HB_FUNC( __OLECREATEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */
{
wchar_t* cCLSID;
GUID ClassID, iid = IID_IDispatch;
IDispatch* pDisp = NULL;
const char* cOleName = hb_parc( 1 );
const char* cID = hb_parc( 2 );
HRESULT lOleError;
wchar_t * cCLSID;
GUID ClassID, iid = IID_IDispatch;
IDispatch * pDisp = NULL;
const char * cOleName = hb_parc( 1 );
const char * cID = hb_parc( 2 );
HRESULT lOleError;
hb_oleInit();
@@ -1469,9 +1472,9 @@ HB_FUNC( __OLECREATEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */
{
cCLSID = AnsiToWide( cOleName );
if( cOleName[ 0 ] == '{' )
lOleError = CLSIDFromString( (LPOLESTR) cCLSID, &ClassID );
lOleError = CLSIDFromString( ( LPOLESTR ) cCLSID, &ClassID );
else
lOleError = CLSIDFromProgID( (LPCOLESTR) cCLSID, &ClassID );
lOleError = CLSIDFromProgID( ( LPCOLESTR ) cCLSID, &ClassID );
hb_xfree( cCLSID );
if( cID )
@@ -1489,7 +1492,7 @@ HB_FUNC( __OLECREATEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */
}
if( lOleError == S_OK )
lOleError = CoCreateInstance( HB_ID_REF( ClassID ), NULL, CLSCTX_SERVER, HB_ID_REF( iid ), ( void** ) ( void * ) &pDisp );
lOleError = CoCreateInstance( HB_ID_REF( ClassID ), NULL, CLSCTX_SERVER, HB_ID_REF( iid ), ( void ** ) ( void * ) &pDisp );
}
else
lOleError = CO_E_CLASSSTRING;
@@ -1507,13 +1510,13 @@ HB_FUNC( __OLEGETACTIVEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */
#if defined( HB_OS_WIN_CE )
hb_oleSetError( E_NOTIMPL );
#else
BSTR wCLSID;
IID ClassID, iid = IID_IDispatch;
IDispatch* pDisp = NULL;
IUnknown* pUnk = NULL;
const char* cOleName = hb_parc( 1 );
const char* cID = hb_parc( 2 );
HRESULT lOleError;
BSTR wCLSID;
IID ClassID, iid = IID_IDispatch;
IDispatch * pDisp = NULL;
IUnknown * pUnk = NULL;
const char * cOleName = hb_parc( 1 );
const char * cID = hb_parc( 2 );
HRESULT lOleError;
hb_oleInit();
@@ -1546,7 +1549,7 @@ HB_FUNC( __OLEGETACTIVEOBJECT ) /* ( cOleName | cCLSID [, cIID ] ) */
if( lOleError == S_OK )
{
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( iid ), ( void** ) ( void * ) &pDisp );
lOleError = HB_VTBL( pUnk )->QueryInterface( HB_THIS_( pUnk ) HB_ID_REF( iid ), ( void ** ) ( void * ) &pDisp );
HB_VTBL( pUnk )->Release( HB_THIS( pUnk ) );
}
}
@@ -1574,7 +1577,7 @@ HB_FUNC( __OLEENUMCREATE ) /* ( __hObj ) */
HRESULT lOleError;
pDisp = hb_oleParam( 1 );
if( !pDisp )
if( ! pDisp )
return;
if( hb_parl( 2 ) )
@@ -1597,12 +1600,12 @@ HB_FUNC( __OLEENUMCREATE ) /* ( __hObj ) */
{
if( V_VT( &variant ) == VT_UNKNOWN )
lOleError = HB_VTBL( V_UNKNOWN( &variant ) )->QueryInterface(
HB_THIS_( HB_WIN_U3( &variant, punkVal ) )
HB_ID_REF( IID_IEnumVARIANT ), ( void** ) ( void * ) &pEnum );
HB_THIS_( HB_WIN_U3( &variant, punkVal ) )
HB_ID_REF( IID_IEnumVARIANT ), ( void ** ) ( void * ) &pEnum );
else if( V_VT( &variant ) == VT_DISPATCH )
lOleError = HB_VTBL( HB_WIN_U3( &variant, pdispVal ) )->QueryInterface(
HB_THIS_( HB_WIN_U3( &variant, pdispVal ) )
HB_ID_REF( IID_IEnumVARIANT ), ( void** ) ( void * ) &pEnum );
HB_THIS_( HB_WIN_U3( &variant, pdispVal ) )
HB_ID_REF( IID_IEnumVARIANT ), ( void ** ) ( void * ) &pEnum );
else
{
VariantClear( &variant );
@@ -1615,11 +1618,11 @@ HB_FUNC( __OLEENUMCREATE ) /* ( __hObj ) */
if( lOleError == S_OK )
{
IEnumVARIANT** ppEnum;
IEnumVARIANT ** ppEnum;
hb_oleSetError( S_OK );
ppEnum = ( IEnumVARIANT** ) hb_gcAllocate( sizeof( IEnumVARIANT* ), &s_gcOleenumFuncs );
ppEnum = ( IEnumVARIANT ** ) hb_gcAllocate( sizeof( IEnumVARIANT * ), &s_gcOleenumFuncs );
*ppEnum = pEnum;
hb_retptrGC( ppEnum );
return;
@@ -1637,7 +1640,7 @@ HB_FUNC( __OLEENUMNEXT )
if( pEnum )
{
VARIANTARG variant;
VARIANTARG variant;
hb_oleInit();
@@ -1662,7 +1665,7 @@ HB_FUNC( WIN_OLEERROR )
HB_FUNC( WIN_OLEERRORTEXT )
{
HRESULT lOleError;
HRESULT lOleError;
if( HB_ISNUM( 1 ) )
lOleError = hb_parnl( 1 );
@@ -1694,7 +1697,7 @@ HB_FUNC( WIN_OLEERRORTEXT )
case DISP_E_PARAMNOTOPTIONAL: hb_retc_const( "DISP_E_PARAMNOTOPTIONAL" ); break;
default:
{
char buf[ 16 ];
char buf[ 16 ];
hb_snprintf( buf, 16, "0x%08x", ( UINT ) ( HB_PTRUINT ) lOleError );
hb_retc( buf );
@@ -1726,17 +1729,17 @@ obj.name(param) = value name PROPERTYPUT 2 | Not supported,
HB_FUNC( WIN_OLEAUTO___ONERROR )
{
IDispatch* pDisp;
const char* szMethod;
wchar_t szMethodWide[ HB_SYMBOL_NAME_LEN + 1 ];
OLECHAR* pMemberArray;
DISPID dispid;
DISPPARAMS dispparam;
VARIANTARG variant;
EXCEPINFO excep;
UINT uiArgErr;
HRESULT lOleError;
HB_USHORT uiClass;
IDispatch * pDisp;
const char * szMethod;
wchar_t szMethodWide[ HB_SYMBOL_NAME_LEN + 1 ];
OLECHAR * pMemberArray;
DISPID dispid;
DISPPARAMS dispparam;
VARIANTARG variant;
EXCEPINFO excep;
UINT uiArgErr;
HRESULT lOleError;
HB_USHORT uiClass;
hb_oleInit();
@@ -1748,7 +1751,7 @@ HB_FUNC( WIN_OLEAUTO___ONERROR )
hb_vmSend( 0 );
pDisp = hb_oleParam( -1 );
if( !pDisp )
if( ! pDisp )
return;
szMethod = hb_itemGetSymbol( hb_stackBaseItem() )->szName;
@@ -1764,7 +1767,7 @@ HB_FUNC( WIN_OLEAUTO___ONERROR )
if( lOleError == S_OK )
{
DISPID lPropPut = DISPID_PROPERTYPUT;
DISPID lPropPut = DISPID_PROPERTYPUT;
memset( &excep, 0, sizeof( excep ) );
GetParams( &dispparam, 0, HB_FALSE );
@@ -1856,7 +1859,7 @@ HB_FUNC( WIN_OLEAUTO___ONERROR )
HB_FUNC( WIN_OLEAUTO___OPINDEX )
{
IDispatch* pDisp;
IDispatch * pDisp;
DISPPARAMS dispparam;
VARIANTARG variant;
EXCEPINFO excep;
@@ -1875,7 +1878,7 @@ HB_FUNC( WIN_OLEAUTO___OPINDEX )
hb_vmSend( 0 );
pDisp = hb_oleParam( -1 );
if( !pDisp )
if( ! pDisp )
return;
fAssign = hb_pcount() > 1;
@@ -1883,7 +1886,7 @@ HB_FUNC( WIN_OLEAUTO___OPINDEX )
if( fAssign )
{
/* Assign */
DISPID lPropPut = DISPID_PROPERTYPUT;
DISPID lPropPut = DISPID_PROPERTYPUT;
memset( &excep, 0, sizeof( excep ) );
GetParams( &dispparam, 0, HB_FALSE );
@@ -1901,7 +1904,7 @@ HB_FUNC( WIN_OLEAUTO___OPINDEX )
}
else
{
/* Access */
/* Access */
memset( &excep, 0, sizeof( excep ) );
VariantInit( &variant );
GetParams( &dispparam, 0, HB_TRUE );
@@ -1985,15 +1988,15 @@ static void hb_oleInvokeCall( WORD wFlags )
pDisp = pObject ? hb_oleItemGetDispatch( pObject ) : NULL;
if( pDisp )
{
DISPID dispid;
DISPPARAMS dispparam;
VARIANTARG variant;
EXCEPINFO excep;
UINT uiArgErr;
HRESULT lOleError;
HB_USHORT uiClass;
OLECHAR* pwszMethod;
void* hMethod;
DISPID dispid;
DISPPARAMS dispparam;
VARIANTARG variant;
EXCEPINFO excep;
UINT uiArgErr;
HRESULT lOleError;
HB_USHORT uiClass;
OLECHAR * pwszMethod;
void * hMethod;
uiClass = hb_objGetClass( pObject );
++uiOffset;
@@ -2016,7 +2019,7 @@ static void hb_oleInvokeCall( WORD wFlags )
memset( &excep, 0, sizeof( excep ) );
VariantInit( &variant );
GetParams( &dispparam, uiOffset, !fPut );
GetParams( &dispparam, uiOffset, ! fPut );
if( fPut )
{
dispparam.rgdispidNamedArgs = &lPropPut;
@@ -2027,7 +2030,7 @@ static void hb_oleInvokeCall( WORD wFlags )
LOCALE_USER_DEFAULT, wFlags,
&dispparam, &variant, &excep, &uiArgErr );
if( !fPut )
if( ! fPut )
PutParams( &dispparam, uiOffset, uiClass );
FreeParams( &dispparam );
@@ -2098,7 +2101,7 @@ HB_FUNC( __OLEVARIANTNEW )
{
int iType = hb_parni( 1 );
PHB_ITEM pInit = hb_param( 2, HB_IT_ANY );
IDispatch* pDisp;
IDispatch * pDisp;
VARIANT variant;
V_VT( &variant ) = VT_ILLEGAL;
@@ -2148,7 +2151,7 @@ HB_FUNC( __OLEVARIANTNEW )
V_VT( &variant ) = VT_I8;
#if defined( HB_OLE_NO_LL )
/* workaround for wrong OLE variant structure definition */
* ( ( HB_LONGLONG * ) &V_I4( &variant ) ) = hb_itemGetNInt( pInit );
*( ( HB_LONGLONG * ) &V_I4( &variant ) ) = hb_itemGetNInt( pInit );
#else
V_I8( &variant ) = hb_itemGetNInt( pInit );
#endif
@@ -2185,7 +2188,7 @@ HB_FUNC( __OLEVARIANTNEW )
V_VT( &variant ) = VT_UI8;
#if defined( HB_OLE_NO_LL )
/* workaround for wrong OLE variant structure definition */
* ( ( HB_ULONGLONG * ) &V_I4( &variant ) ) = hb_itemGetNInt( pInit );
*( ( HB_ULONGLONG * ) &V_I4( &variant ) ) = hb_itemGetNInt( pInit );
#else
V_UI8( &variant ) = hb_itemGetNInt( pInit );
#endif
@@ -2279,7 +2282,7 @@ HB_FUNC( __OLEVARIANTNEW )
if( pInit == NULL || HB_IS_STRING( pInit ) )
{
V_ARRAY( &variant ) = hb_oleSafeArrayFromString( pInit,
( VARTYPE ) ( iType & VT_TYPEMASK ) );
( VARTYPE ) ( iType & VT_TYPEMASK ) );
if( V_ARRAY( &variant ) )
V_VT( &variant ) = ( VARTYPE ) iType;
}
@@ -2290,8 +2293,8 @@ HB_FUNC( __OLEVARIANTNEW )
if( pDisp )
{
if( HB_VTBL( pDisp )->QueryInterface( HB_THIS_( pDisp )
HB_ID_REF( IID_IEnumVARIANT ),
( void** ) ( void * ) &V_UNKNOWN( &variant ) ) == S_OK )
HB_ID_REF( IID_IEnumVARIANT ),
( void ** ) ( void * ) &V_UNKNOWN( &variant ) ) == S_OK )
{
V_VT( &variant ) = VT_UNKNOWN;
}
@@ -2323,6 +2326,6 @@ HB_CALL_ON_STARTUP_END( _hb_olecore_init_ )
#if defined( HB_PRAGMA_STARTUP )
#pragma startup _hb_olecore_init_
#elif defined( HB_DATASEG_STARTUP )
#define HB_DATASEG_BODY HB_DATASEG_FUNC( _hb_olecore_init_ )
#define HB_DATASEG_BODY HB_DATASEG_FUNC( _hb_olecore_init_ )
#include "hbiniseg.h"
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,7 @@ TCHAR * hbwapi_tstrdup( const TCHAR * pszText )
TCHAR * pszDup;
HB_SIZE nLen;
HB_TRACE(HB_TR_DEBUG, ("hbwapi_tstrdup(%p)", pszText));
HB_TRACE( HB_TR_DEBUG, ( "hbwapi_tstrdup(%p)", pszText ) );
nLen = ( hbwapi_tstrlen( pszText ) + 1 ) * sizeof( TCHAR );
@@ -73,7 +73,7 @@ TCHAR * hbwapi_tstrncat( TCHAR * pDest, const TCHAR * pSource, HB_SIZE nLen )
{
TCHAR * pBuf = pDest;
HB_TRACE(HB_TR_DEBUG, ("hbwapi_tstrncat(%p, %p, %" HB_PFS "u)", pDest, pSource, nLen));
HB_TRACE( HB_TR_DEBUG, ( "hbwapi_tstrncat(%p, %p, %" HB_PFS "u)", pDest, pSource, nLen ) );
pDest[ nLen ] = TEXT( '\0' );
@@ -93,7 +93,7 @@ HB_SIZE hbwapi_tstrlen( const TCHAR * pText )
{
HB_SIZE nLen = 0;
HB_TRACE(HB_TR_DEBUG, ("hbwapi_tstrlen(%p)", pText));
HB_TRACE( HB_TR_DEBUG, ( "hbwapi_tstrlen(%p)", pText ) );
while( pText[ nLen ] != TEXT( '\0' ) )
++nLen;

View File

@@ -86,6 +86,7 @@ HB_FUNC( WAPI_GETCURRENTTHREADID )
HB_FUNC( WAPI_WAITFORSINGLEOBJECT )
{
DWORD dwResult = WaitForSingleObject( hbwapi_par_raw_HANDLE( 1 ), ( DWORD ) hb_parnl( 2 ) );
hbwapi_SetLastError( GetLastError() );
hb_retnl( dwResult );
}
@@ -199,6 +200,7 @@ HB_FUNC( WAPI_GETLASTERROR )
HB_FUNC( WAPI_SETLASTERROR )
{
DWORD dwLastError = ( DWORD ) hb_parnl( 1 );
SetLastError( dwLastError );
hbwapi_SetLastError( dwLastError );
}
@@ -222,6 +224,7 @@ HB_FUNC( WAPI_LOADLIBRARY )
HB_FUNC( WAPI_FREELIBRARY )
{
BOOL bResult = FreeLibrary( ( HMODULE ) hb_parptr( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
@@ -231,7 +234,7 @@ HB_FUNC( WAPI_GETPROCADDRESS )
FARPROC pProc;
DWORD dwLastError;
pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ), HB_ISCHAR( 2 ) ?
hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) );
hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) );
dwLastError = GetLastError();
hbwapi_SetLastError( dwLastError );
hb_retptr( ( void * ) ( HB_PTRDIFF ) pProc );
@@ -306,7 +309,7 @@ HB_FUNC( WAPI_MULDIV )
hb_retni( MulDiv( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) );
}
#if !defined( HB_OS_WIN_CE )
#if ! defined( HB_OS_WIN_CE )
/* WinCE does not support GetShortPathName()/GetLongPathName() functions */
@@ -337,7 +340,7 @@ static void s_getPathName( _HB_GETPATHNAME getPathName )
}
length = getPathName( lpszLongPath, lpszShortPath, cchBuffer );
if( !fSize && length > cchBuffer ) /* default buffer size was too small */
if( ! fSize && length > cchBuffer ) /* default buffer size was too small */
{
cchBuffer = length;
lpszShortPath = ( LPTSTR ) hb_xgrab( cchBuffer * sizeof( TCHAR ) );
@@ -362,7 +365,7 @@ static void s_getPathName( _HB_GETPATHNAME getPathName )
HB_FUNC( WAPI_GETSHORTPATHNAME )
{
#if !defined( HB_OS_WIN_CE )
#if ! defined( HB_OS_WIN_CE )
s_getPathName( GetShortPathName );
#else
{
@@ -375,20 +378,20 @@ HB_FUNC( WAPI_GETSHORTPATHNAME )
HB_FUNC( WAPI_GETLONGPATHNAME )
{
#if !defined( HB_OS_WIN_CE )
#if ! defined( HB_OS_WIN_CE )
static _HB_GETPATHNAME s_getPathNameAddr = NULL;
if( !s_getPathNameAddr )
if( ! s_getPathNameAddr )
{
s_getPathNameAddr = ( _HB_GETPATHNAME )
#if defined( UNICODE )
GetProcAddress( GetModuleHandle( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) ),
"GetLongPathNameW" );
GetProcAddress( GetModuleHandle( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) ),
"GetLongPathNameW" );
#else
GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ),
"GetLongPathNameA" );
GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ),
"GetLongPathNameA" );
#endif
if( !s_getPathNameAddr )
if( ! s_getPathNameAddr )
s_getPathNameAddr = GetShortPathName;
}
s_getPathName( s_getPathNameAddr );
@@ -458,6 +461,7 @@ HB_FUNC( WAPI_QUERYPERFORMANCECOUNTER )
{
LARGE_INTEGER counter;
BOOL result = QueryPerformanceCounter( &counter );
if( result )
hb_stornint( HBWAPI_GET_LARGEUINT( counter ), 1 );
hb_retl( result != 0 );
@@ -467,6 +471,7 @@ HB_FUNC( WAPI_QUERYPERFORMANCEFREQUENCY )
{
LARGE_INTEGER frequency;
BOOL result = QueryPerformanceFrequency( &frequency );
if( result )
hb_stornint( HBWAPI_GET_LARGEUINT( frequency ), 1 );
hb_retl( result != 0 );

View File

@@ -208,15 +208,15 @@ LOGFONT * hbwapi_par_LOGFONT( LOGFONT * p, int iParam, HB_BOOL bMandatory )
}
else if( pStru && HB_IS_ARRAY( pStru ) && hb_arrayLen( pStru ) >= 14 )
{
p->lfHeight = ( LONG ) hb_arrayGetNL( pStru, 1 );
p->lfWidth = ( LONG ) hb_arrayGetNL( pStru, 2 );
p->lfEscapement = ( LONG ) hb_arrayGetNL( pStru, 3 );
p->lfOrientation = ( LONG ) hb_arrayGetNL( pStru, 4 );
p->lfWeight = ( LONG ) hb_arrayGetNL( pStru, 5 );
p->lfItalic = ( BYTE ) hb_arrayGetNI( pStru, 6 );
p->lfUnderline = ( BYTE ) hb_arrayGetNI( pStru, 7 );
p->lfStrikeOut = ( BYTE ) hb_arrayGetNI( pStru, 8 );
p->lfCharSet = ( BYTE ) hb_arrayGetNI( pStru, 9 );
p->lfHeight = ( LONG ) hb_arrayGetNL( pStru, 1 );
p->lfWidth = ( LONG ) hb_arrayGetNL( pStru, 2 );
p->lfEscapement = ( LONG ) hb_arrayGetNL( pStru, 3 );
p->lfOrientation = ( LONG ) hb_arrayGetNL( pStru, 4 );
p->lfWeight = ( LONG ) hb_arrayGetNL( pStru, 5 );
p->lfItalic = ( BYTE ) hb_arrayGetNI( pStru, 6 );
p->lfUnderline = ( BYTE ) hb_arrayGetNI( pStru, 7 );
p->lfStrikeOut = ( BYTE ) hb_arrayGetNI( pStru, 8 );
p->lfCharSet = ( BYTE ) hb_arrayGetNI( pStru, 9 );
p->lfOutPrecision = ( BYTE ) hb_arrayGetNI( pStru, 10 );
p->lfClipPrecision = ( BYTE ) hb_arrayGetNI( pStru, 11 );
p->lfQuality = ( BYTE ) hb_arrayGetNI( pStru, 12 );
@@ -542,19 +542,21 @@ HB_FUNC( WAPI_TEXTOUT )
LPCTSTR lpData = HB_PARSTR( 4, &hData, &nDataLen );
#if ! defined( HB_OS_WIN_CE )
hb_retl( TextOut( hDC, hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
lpData,
( int ) nDataLen ) );
hb_retl( TextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
lpData,
( int ) nDataLen ) );
#else
/* Emulating TextOut() using ExtTextOut(). [vszakats] */
hb_retl( ExtTextOut( hDC, hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
0,
NULL,
lpData,
( UINT ) nDataLen,
NULL ) );
hb_retl( ExtTextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
0,
NULL,
lpData,
( UINT ) nDataLen,
NULL ) );
#endif
hb_strfree( hData );
@@ -599,13 +601,14 @@ HB_FUNC( WAPI_EXTTEXTOUT )
lpFontWidths = NULL;
hb_retl( ExtTextOut( hDC, hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
( UINT ) hb_parni( 4 ) /* fuOptions */,
hbwapi_par_RECT( &rect, 5, HB_FALSE ),
lpData,
( UINT ) nDataLen,
lpFontWidths ) );
hb_retl( ExtTextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
( UINT ) hb_parni( 4 ) /* fuOptions */,
hbwapi_par_RECT( &rect, 5, HB_FALSE ),
lpData,
( UINT ) nDataLen,
lpFontWidths ) );
if( lpFontWidths )
hb_xfree( lpFontWidths );
@@ -682,6 +685,7 @@ HB_FUNC( WAPI_CREATEPEN )
HB_FUNC( WAPI_CREATESOLIDBRUSH )
{
HBRUSH h = CreateSolidBrush( ( COLORREF ) hb_parnl( 1 ) /* crColor */ );
#if defined( HB_OS_WIN_CE )
hbwapi_SetLastError( GetLastError() );
#endif
@@ -753,7 +757,7 @@ HB_FUNC( WAPI_SELECTOBJECT )
if( bRegion )
hb_retnint( ( HB_PTRDIFF ) SelectObject( hDC, h ) );
else
hb_retl( SelectObject( hDC, h ) != NULL ); /* NOTE: We don't return a raw pointer. */
hb_retl( SelectObject( hDC, h ) != NULL ); /* NOTE: We don't return a raw pointer. */
}
else
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );

View File

@@ -55,6 +55,7 @@
HB_FUNC( WAPI_ADDFONTRESOURCE )
{
void * hFileName;
hb_retni( AddFontResource( HB_PARSTRDEF( 1, &hFileName, NULL ) ) );
hb_strfree( hFileName );
}
@@ -62,6 +63,7 @@ HB_FUNC( WAPI_ADDFONTRESOURCE )
HB_FUNC( WAPI_REMOVEFONTRESOURCE )
{
void * hFileName;
hb_retni( RemoveFontResource( HB_PARSTRDEF( 1, &hFileName, NULL ) ) );
hb_strfree( hFileName );
}

View File

@@ -54,9 +54,9 @@
#include "hbwapi.h"
#include "hbapierr.h"
/* For: ( defined( HB_OS_WIN_CE ) && defined( _MSC_VER ) && ( _MSC_VER <= 1310 ) ) */
#ifndef WS_OVERLAPPEDWINDOW
/* For: ( defined( HB_OS_WIN_CE ) && defined( _MSC_VER ) && ( _MSC_VER <= 1310 ) ) */
# define WS_OVERLAPPEDWINDOW ( WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX )
# define WS_OVERLAPPEDWINDOW ( WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX )
#endif
HB_FUNC( WAPI_SETWINDOWPOS )
@@ -68,6 +68,7 @@ HB_FUNC( WAPI_SETWINDOWPOS )
hb_parni( 5 ),
hb_parni( 6 ),
( UINT ) hb_parnl( 7 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
@@ -93,6 +94,7 @@ HB_FUNC( WAPI_ISZOOMED )
HB_FUNC( WAPI_GETSYSTEMMETRICS )
{
int iResult = GetSystemMetrics( hbwapi_par_INT( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_NI( iResult );
}
@@ -115,6 +117,7 @@ HB_FUNC( WAPI_MESSAGEBOX )
HB_PARSTR( 2, &hStr1, NULL ),
HB_PARSTR( 3, &hStr2, NULL ),
hbwapi_par_INT( 4 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_NI( iResult );
hb_strfree( hStr1 );
@@ -124,6 +127,7 @@ HB_FUNC( WAPI_MESSAGEBOX )
HB_FUNC( WAPI_MESSAGEBEEP )
{
BOOL bResult = MessageBeep( hbwapi_par_UINT( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
@@ -153,15 +157,15 @@ HB_FUNC( WAPI_CREATEWINDOWEX )
hbwapi_par_DWORD( 1 ), /* dwExStyle */
HB_PARSTRDEF( 2, &hClassName, NULL ),
HB_PARSTRDEF( 3, &hWindowName, NULL ),
HB_ISNUM( 4 ) ? hbwapi_par_DWORD( 4 ) : WS_OVERLAPPEDWINDOW, /* dwStyle */
HB_ISNUM( 5 ) ? hbwapi_par_INT( 5 ) : ( int ) CW_USEDEFAULT, /* x */
HB_ISNUM( 6 ) ? hbwapi_par_INT( 6 ) : ( int ) CW_USEDEFAULT, /* y */
hbwapi_par_INT( 7 ), /* nWidth */
hbwapi_par_INT( 8 ), /* nHeight */
hbwapi_par_raw_HWND( 9 ), /* hWndParent, default to HWND_DESKTOP */
hbwapi_par_raw_HMENU( 10 ), /* hMenu */
hbwapi_par_raw_HINSTANCE( 11 ), /* hInstance */
( LPVOID ) hb_parptr( 12 ) /* lpParam */ );
HB_ISNUM( 4 ) ? hbwapi_par_DWORD( 4 ) : WS_OVERLAPPEDWINDOW, /* dwStyle */
HB_ISNUM( 5 ) ? hbwapi_par_INT( 5 ) : ( int ) CW_USEDEFAULT, /* x */
HB_ISNUM( 6 ) ? hbwapi_par_INT( 6 ) : ( int ) CW_USEDEFAULT, /* y */
hbwapi_par_INT( 7 ), /* nWidth */
hbwapi_par_INT( 8 ), /* nHeight */
hbwapi_par_raw_HWND( 9 ), /* hWndParent, default to HWND_DESKTOP */
hbwapi_par_raw_HMENU( 10 ), /* hMenu */
hbwapi_par_raw_HINSTANCE( 11 ), /* hInstance */
( LPVOID ) hb_parptr( 12 ) /* lpParam */ );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HWND( hResult );
@@ -173,6 +177,7 @@ HB_FUNC( WAPI_CREATEWINDOWEX )
HB_FUNC( WAPI_DESTROYWINDOW )
{
BOOL bResult = DestroyWindow( hbwapi_par_raw_HWND( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
@@ -180,6 +185,7 @@ HB_FUNC( WAPI_DESTROYWINDOW )
HB_FUNC( WAPI_ISWINDOW )
{
BOOL bResult = IsWindow( hbwapi_par_raw_HWND( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
@@ -213,8 +219,8 @@ HB_FUNC( WAPI_DRAWTEXT )
BEGIN SCROLLBAR MANIPULATION WINAPI FUNCTIONS
/-----------------------------------------------------------------------*/
/*
BOOL EnableScrollBar( HWND hWnd, UINT wSBflags, UINT wArrows );
*/
BOOL EnableScrollBar( HWND hWnd, UINT wSBflags, UINT wArrows );
*/
HB_FUNC( WAPI_ENABLESCROLLBAR )
{
BOOL bResult;
@@ -235,18 +241,18 @@ HB_FUNC( WAPI_ENABLESCROLLBAR )
}
/*
BOOL GetScrollBarInfo( HWND hwnd, LONG idObject, PSCROLLBARINFO psbi );
$$
Local strSCROLLBARINFO IS SCROLLBARINFO
Local cSCROLLBARINFO = strSCROLLBARINFO:value
Local nCtrlType = OBJID_CLIENT | OBJID_HSCROLL | OBJID_VSCROLL
BOOL GetScrollBarInfo( HWND hwnd, LONG idObject, PSCROLLBARINFO psbi );
$$
Local strSCROLLBARINFO IS SCROLLBARINFO
Local cSCROLLBARINFO = strSCROLLBARINFO:value
Local nCtrlType = OBJID_CLIENT | OBJID_HSCROLL | OBJID_VSCROLL
lSuccess := WAPI_GetScrollInfo( hWnd, nCtrType, @cSCROLLINFO )
lSuccess := WAPI_GetScrollInfo( hWnd, nCtrType, @cSCROLLINFO )
strSCROLLBARINFO:buffer( cSCROLLBARINFO )
? strSCROLLINFO:
$$
*/
strSCROLLBARINFO:buffer( cSCROLLBARINFO )
? strSCROLLINFO:
$$
*/
#if 0
HB_FUNC( WAPI_GETSCROLLBARINFO )
{
@@ -270,8 +276,8 @@ HB_FUNC( WAPI_GETSCROLLBARINFO )
#endif
/*
BOOL GetScrollInfo( HWND hwnd, int fnBar, LPSCROLLINFO lpsi );
*/
BOOL GetScrollInfo( HWND hwnd, int fnBar, LPSCROLLINFO lpsi );
*/
HB_FUNC( WAPI_GETSCROLLINFO )
{
LPSCROLLINFO si = ( LPSCROLLINFO ) hbwapi_par_raw_STRUCT( 3 );
@@ -290,8 +296,8 @@ HB_FUNC( WAPI_GETSCROLLINFO )
}
/*
int GetScrollPos( HWND hWnd, int nBar );
*/
int GetScrollPos( HWND hWnd, int nBar );
*/
HB_FUNC( WAPI_GETSCROLLPOS )
{
int iResult;
@@ -311,8 +317,8 @@ HB_FUNC( WAPI_GETSCROLLPOS )
}
/*
BOOL GetScrollRange( HWND hWnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos );
*/
BOOL GetScrollRange( HWND hWnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos );
*/
HB_FUNC( WAPI_GETSCROLLRANGE )
{
BOOL bSuccess;
@@ -343,27 +349,27 @@ HB_FUNC( WAPI_GETSCROLLRANGE )
#if 0
/*
BOOL ScrollDC( HDC hDC, int dx, int dy, const RECT *lprcScroll, const RECT *lprcClip,
BOOL ScrollDC( HDC hDC, int dx, int dy, const RECT *lprcScroll, const RECT *lprcClip,
HRGN hrgnUpdate, LPRECT lprcUpdate );
*/
*/
HB_FUNC( WAPI_SCROLLDC )
{
}
/*
BOOL ScrollWindow( HWND hWnd, int XAmount, int YAmount, const RECT *lpRect,
BOOL ScrollWindow( HWND hWnd, int XAmount, int YAmount, const RECT *lpRect,
const RECT *lpClipRect );
*/
*/
HB_FUNC( WAPI_SCROLLWINDOW )
{
}
/*
int ScrollWindowEx( HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip,
int ScrollWindowEx( HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip,
HRGN hrgnUpdate, LPRECT prcUpdate, UINT flags );
*/
*/
HB_FUNC( WAPI_SCROLLWINDOWEX )
{
@@ -371,8 +377,8 @@ HB_FUNC( WAPI_SCROLLWINDOWEX )
#endif
/*
int SetScrollInfo( HWND hwnd, int fnBar, LPCSCROLLINFO lpsi, BOOL fRedraw );
*/
int SetScrollInfo( HWND hwnd, int fnBar, LPCSCROLLINFO lpsi, BOOL fRedraw );
*/
HB_FUNC( WAPI_SETSCROLLINFO )
{
LPSCROLLINFO si = ( LPSCROLLINFO ) hbwapi_par_raw_STRUCT( 3 );
@@ -384,21 +390,22 @@ HB_FUNC( WAPI_SETSCROLLINFO )
}
/*
int SetScrollPos( HWND hWnd, int nBar, int nPos, BOOL bRedraw );
*/
int SetScrollPos( HWND hWnd, int nBar, int nPos, BOOL bRedraw );
*/
HB_FUNC( WAPI_SETSCROLLPOS )
{
int iResult = SetScrollPos( hbwapi_par_raw_HWND( 1 ),
hbwapi_par_INT( 2 ),
hbwapi_par_INT( 3 ),
hbwapi_par_BOOL( 4 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_NI( iResult );
}
/*
BOOL SetScrollRange( HWND hWnd, int nBar, int nMinPos, int nMaxPos, BOOL bRedraw );
*/
BOOL SetScrollRange( HWND hWnd, int nBar, int nMinPos, int nMaxPos, BOOL bRedraw );
*/
HB_FUNC( WAPI_SETSCROLLRANGE )
{
BOOL bResult = SetScrollRange( hbwapi_par_raw_HWND( 1 ),
@@ -406,13 +413,14 @@ HB_FUNC( WAPI_SETSCROLLRANGE )
hbwapi_par_INT( 3 ),
hbwapi_par_INT( 4 ),
HB_ISLOG( 5 ) ? hbwapi_par_BOOL( 5 ) : TRUE );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( bResult );
}
/*
BOOL ShowScrollBar( HWND hWnd, int wBar, BOOL bShow );
*/
BOOL ShowScrollBar( HWND hWnd, int wBar, BOOL bShow );
*/
HB_FUNC( WAPI_SHOWSCROLLBAR )
{
BOOL bResult;
@@ -435,6 +443,7 @@ HB_FUNC( WAPI_SHOWSCROLLBAR )
HB_FUNC( WAPI_SETFOCUS )
{
HWND hWnd = SetFocus( hbwapi_par_raw_HWND( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HWND( hWnd );
}
@@ -447,6 +456,7 @@ HB_FUNC( WAPI_GETACTIVEWINDOW )
HB_FUNC( WAPI_SETACTIVEWINDOW )
{
HWND hWnd = SetActiveWindow( hbwapi_par_raw_HWND( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HWND( hWnd );
}
@@ -474,7 +484,7 @@ HB_FUNC( WAPI_LOADIMAGE )
hImage = LoadImage( hbwapi_par_raw_HINSTANCE( 1 ),
HB_ISNUM( 2 ) ? MAKEINTRESOURCE( hbwapi_par_INT( 2 ) ) :
HB_PARSTR( 2, &hString, NULL ),
HB_PARSTR( 2, &hString, NULL ),
HB_ISNUM( 3 ) ? hbwapi_par_UINT( 3 ) : IMAGE_BITMAP,
hbwapi_par_INT( 4 ), /* desired width */
hbwapi_par_INT( 5 ), /* desired height */
@@ -508,6 +518,7 @@ HB_FUNC( WAPI_LOADMENU )
HB_FUNC( WAPI_CREATEMENU )
{
HMENU hMenu = CreateMenu();
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HMENU( hMenu );
}
@@ -515,6 +526,7 @@ HB_FUNC( WAPI_CREATEMENU )
HB_FUNC( WAPI_CREATEPOPUPMENU )
{
HMENU hMenu = CreatePopupMenu();
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HMENU( hMenu );
}
@@ -522,6 +534,7 @@ HB_FUNC( WAPI_CREATEPOPUPMENU )
HB_FUNC( WAPI_DESTROYMENU )
{
BOOL fResult = DestroyMenu( hbwapi_par_raw_HMENU( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( fResult );
}
@@ -531,6 +544,7 @@ HB_FUNC( WAPI_GETSYSTEMMENU )
HWND hWnd = hbwapi_par_raw_HWND( 1 );
HMENU hMenu = GetSystemMenu( hWnd ? hWnd : GetActiveWindow(),
hbwapi_par_BOOL( 2 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HMENU( hMenu );
}
@@ -538,6 +552,7 @@ HB_FUNC( WAPI_GETSYSTEMMENU )
HB_FUNC( WAPI_GETSUBMENU )
{
HMENU hMenu = GetSubMenu( hbwapi_par_raw_HMENU( 1 ), hbwapi_par_INT( 2 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_raw_HMENU( hMenu );
}
@@ -546,6 +561,7 @@ HB_FUNC( WAPI_DRAWMENUBAR )
{
HWND hWnd = hbwapi_par_raw_HWND( 1 );
BOOL fResult = DrawMenuBar( hWnd ? hWnd : GetActiveWindow() );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( fResult );
}
@@ -555,13 +571,13 @@ HB_FUNC( WAPI_TRACKPOPUPMENU )
HWND hWnd = hbwapi_par_raw_HWND( 6 );
UINT uiResult;
uiResult = TrackPopupMenu( hbwapi_par_raw_HMENU( 1 ), /* hMenu */
hbwapi_par_UINT( 2 ), /* uFlags */
hbwapi_par_INT( 3 ), /* x */
hbwapi_par_INT( 4 ), /* y */
hbwapi_par_INT( 5 ), /* nReserved */
uiResult = TrackPopupMenu( hbwapi_par_raw_HMENU( 1 ), /* hMenu */
hbwapi_par_UINT( 2 ), /* uFlags */
hbwapi_par_INT( 3 ), /* x */
hbwapi_par_INT( 4 ), /* y */
hbwapi_par_INT( 5 ), /* nReserved */
hWnd ? hWnd : GetActiveWindow(), /* hWnd */
NULL /* prcRect */ );
NULL /* prcRect */ );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_UINT( uiResult );
}
@@ -597,7 +613,7 @@ HB_FUNC( WAPI_CHECKMENURADIOITEM )
hbwapi_par_UINT( 2 ), /* idFirst */
hbwapi_par_UINT( 3 ), /* idLast */
hbwapi_par_UINT( 4 ), /* idCheck */
hbwapi_par_UINT( 5 ) /* uFlags */ );
hbwapi_par_UINT( 5 ) /* uFlags */ );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( fResult );
}
@@ -848,6 +864,7 @@ HB_FUNC( WAPI_CREATEACCELERATORTABLE )
HB_FUNC( WAPI_DESTROYACCELERATORTABLE )
{
BOOL fResult = DestroyAcceleratorTable( hbwapi_par_raw_HACCEL( 1 ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_L( fResult );
}

View File

@@ -128,10 +128,10 @@ HB_FUNC( WAPI_ENDDIALOG )
*/
HB_FUNC( WAPI_SETDLGITEMTEXT )
{
void * hStr;
int iResult = SetDlgItemText( hbwapi_par_raw_HWND( 1 ),
hbwapi_par_INT( 2 ),
HB_PARSTR( 3, &hStr, NULL ) );
void * hStr;
int iResult = SetDlgItemText( hbwapi_par_raw_HWND( 1 ),
hbwapi_par_INT( 2 ),
HB_PARSTR( 3, &hStr, NULL ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_NI( iResult );
@@ -143,14 +143,14 @@ HB_FUNC( WAPI_SETDLGITEMTEXT )
*/
HB_FUNC( WAPI_GETDLGITEMTEXT )
{
HWND nItem = GetDlgItem( hbwapi_par_raw_HWND( 1 ), hbwapi_par_INT( 2 ) );
int nSize = ( int ) SendMessage( nItem, WM_GETTEXTLENGTH, 0, 0 );
TCHAR * lpResult = ( TCHAR * ) hb_xgrab( ( nSize + 1 ) * sizeof( TCHAR ) );
HWND nItem = GetDlgItem( hbwapi_par_raw_HWND( 1 ), hbwapi_par_INT( 2 ) );
int nSize = ( int ) SendMessage( nItem, WM_GETTEXTLENGTH, 0, 0 );
TCHAR * lpResult = ( TCHAR * ) hb_xgrab( ( nSize + 1 ) * sizeof( TCHAR ) );
UINT nResult = GetDlgItemText( hbwapi_par_raw_HWND( 1 ),
hbwapi_par_INT( 2 ),
lpResult,
nSize + 1 );
UINT nResult = GetDlgItemText( hbwapi_par_raw_HWND( 1 ),
hbwapi_par_INT( 2 ),
lpResult,
nSize + 1 );
HB_RETSTRLEN( lpResult, ( HB_SIZE ) nResult );
hbwapi_SetLastError( GetLastError() );
@@ -171,8 +171,8 @@ HB_FUNC( WAPI_GETDLGITEM )
*/
HB_FUNC( WAPI_COMBOBOX_ADDSTRING )
{
void * hStr;
int iResult = ComboBox_AddString( hbwapi_par_raw_HWND( 1 ), HB_PARSTR( 2, &hStr, NULL ) );
void * hStr;
int iResult = ComboBox_AddString( hbwapi_par_raw_HWND( 1 ), HB_PARSTR( 2, &hStr, NULL ) );
hbwapi_SetLastError( GetLastError() );
hbwapi_ret_NI( iResult );

View File

@@ -132,8 +132,8 @@ HB_FUNC( WCE_SIMWRITEPHONEBOOKENTRY ) /* hSim, nLocation, nPos, cNumber, cName,
void * hAddress;
void * hText;
PhoneEntry.cbSize = sizeof( SIMPHONEBOOKENTRY );
PhoneEntry.dwParams = SIM_PARAM_PBE_ALL;
PhoneEntry.cbSize = sizeof( SIMPHONEBOOKENTRY );
PhoneEntry.dwParams = SIM_PARAM_PBE_ALL;
wcsncpy( PhoneEntry.lpszAddress, HB_PARSTRDEF( 4, &hAddress, NULL ), MAX_LENGTH_ADDRESS );
wcsncpy( PhoneEntry.lpszText , HB_PARSTRDEF( 5, &hText , NULL ), MAX_LENGTH_PHONEBOOKENTRYTEXT );
PhoneEntry.dwAddressType = ( DWORD ) hb_parnl( 7 );

View File

@@ -54,7 +54,7 @@
#if defined( HB_OS_WIN_CE ) && \
! defined( __MINGW32__ ) && \
!( ! defined( __cplusplus ) && ( defined( _MSC_VER ) && ( _MSC_VER <= 1310 ) ) )
! ( ! defined( __cplusplus ) && ( defined( _MSC_VER ) && ( _MSC_VER <= 1310 ) ) )
# include <sms.h>
# define __HB_COMPONENT_SUPPORTED__
#endif
@@ -93,8 +93,8 @@ HB_FUNC( WCE_SMSSENDMESSAGE ) /* cMessage, cNumber */
/* Set up provider specific data */
tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
tpsd.psMessageClass = PS_MESSAGE_CLASS0;
tpsd.psReplaceOption = PSRO_NONE;
tpsd.psMessageClass = PS_MESSAGE_CLASS0;
tpsd.psReplaceOption = PSRO_NONE;
/* Send the message, indicating success or failure */
hb_retnl( SmsSendMessage( smshHandle,

View File

@@ -58,13 +58,13 @@
#include "hbapiitm.h"
#ifndef QUERYESCSUPPORT
#define QUERYESCSUPPORT 8
#define QUERYESCSUPPORT 8
#endif
#ifndef BI_JPEG
#define BI_JPEG 4
#define BI_JPEG 4
#endif
#ifndef BI_PNG
#define BI_PNG 5
#define BI_PNG 5
#endif
/* Functions for loading & printing bitmaps */
@@ -123,10 +123,10 @@ HB_FUNC( WIN_LOADBITMAPFILE )
/* Some compilers don't implement these define [jarabal] */
#ifndef CHECKJPEGFORMAT
#define CHECKJPEGFORMAT 4119
#define CHECKJPEGFORMAT 4119
#endif
#ifndef CHECKPNGFORMAT
#define CHECKPNGFORMAT 4120
#define CHECKPNGFORMAT 4120
#endif
static int hbwin_bitmapIsSupported( HDC hDC, int iType, const void * pImgBuf, HB_SIZE nSize )
@@ -185,23 +185,23 @@ HB_FUNC( WIN_DRAWBITMAP )
[vszakats] */
if( hbwin_bitmapIsSupported( hDC, iType, pbmfh, nSize ) == 0 )
{
int iWidth = hb_parni( 7 );
int iWidth = hb_parni( 7 );
int iHeight = hb_parni( 8 );
if( iType == HB_WIN_BITMAP_BMP )
{
pbmi = ( BITMAPINFO * ) ( pbmfh + 1 );
pbmi = ( BITMAPINFO * ) ( pbmfh + 1 );
pBits = ( BYTE * ) pbmfh + pbmfh->bfOffBits;
/* Remember there are 2 types of BitMap File */
if( pbmi->bmiHeader.biSize == sizeof( BITMAPCOREHEADER ) )
{
iWidth = ( ( BITMAPCOREHEADER * ) pbmi )->bcWidth;
iWidth = ( ( BITMAPCOREHEADER * ) pbmi )->bcWidth;
iHeight = ( ( BITMAPCOREHEADER * ) pbmi )->bcHeight;
}
else
{
iWidth = pbmi->bmiHeader.biWidth;
iWidth = pbmi->bmiHeader.biWidth;
iHeight = abs( pbmi->bmiHeader.biHeight );
}
}

View File

@@ -59,14 +59,14 @@
/* .jpeg size detection code. [vszakats] */
#define _JPEG_RET_OK 0
#define _JPEG_RET_OVERRUN 1
#define _JPEG_RET_INVALID 2
#define _JPEG_RET_UNSUPPORTED 3
#define _JPEG_RET_OK 0
#define _JPEG_RET_OVERRUN 1
#define _JPEG_RET_INVALID 2
#define _JPEG_RET_UNSUPPORTED 3
#define _JPEG_CS_GRAY 1
#define _JPEG_CS_RGB 2
#define _JPEG_CS_CMYK 3
#define _JPEG_CS_GRAY 1
#define _JPEG_CS_RGB 2
#define _JPEG_CS_CMYK 3
static int hb_jpeg_get_param( const HB_BYTE * buffer, HB_SIZE nBufferSize, int * piHeight, int * piWidth, int * piColorSpace, int * piBPC )
{
@@ -170,13 +170,13 @@ static int hb_jpeg_get_param( const HB_BYTE * buffer, HB_SIZE nBufferSize, int *
#if defined( HB_HAS_PNG ) && defined( HB_HAS_ZLIB )
#define _PNG_RET_OK 0
#define _PNG_RET_ERR_INVALID1 1
#define _PNG_RET_ERR_INVALID2 2
#define _PNG_RET_ERR_INIT1 3
#define _PNG_RET_ERR_INIT2 4
#define _PNG_RET_ERR_INIT3 5
#define _PNG_RET_ERR_READ 6
#define _PNG_RET_OK 0
#define _PNG_RET_ERR_INVALID1 1
#define _PNG_RET_ERR_INVALID2 2
#define _PNG_RET_ERR_INIT1 3
#define _PNG_RET_ERR_INIT2 4
#define _PNG_RET_ERR_INIT3 5
#define _PNG_RET_ERR_READ 6
typedef struct
{

View File

@@ -56,14 +56,15 @@
static struct
{
HANDLE hPort;
int iFunction;
DWORD dwError;
HANDLE hPort;
int iFunction;
DWORD dwError;
} s_PortData[ 256 ];
static void hb_wincom_init( void )
{
int i;
for( i = 0; i < ( int ) HB_SIZEOFARRAY( s_PortData ); i++ )
s_PortData[ i ].hPort = INVALID_HANDLE_VALUE;
}
@@ -632,9 +633,9 @@ static int hb_win_ComSetTimeouts( HANDLE hCommPort, LPCOMMTIMEOUTS Timeouts, DWO
For each write operation, this value is multiplied by the number of bytes to be written. */
if( Timeouts->WriteTotalTimeoutMultiplier == ( DWORD ) -1 )
{
/* float of 1.0 makes whole expression float */
NewTimeouts.WriteTotalTimeoutMultiplier = HB_MIN( 1, ( DWORD ) ( ( 1.0 / dwBaudRate ) *
( iByteSize + 1 + ( iParity == NOPARITY ? 0 : 1 ) + ( iStopBits == ONESTOPBIT ? 1 : iStopBits == ONE5STOPBITS ? 1.5 : 2 ) ) * 1000 ) );
/* float of 1.0 makes whole expression float */
NewTimeouts.WriteTotalTimeoutMultiplier = HB_MIN( 1, ( DWORD ) ( ( 1.0 / dwBaudRate ) *
( iByteSize + 1 + ( iParity == NOPARITY ? 0 : 1 ) + ( iStopBits == ONESTOPBIT ? 1 : iStopBits == ONE5STOPBITS ? 1.5 : 2 ) ) * 1000 ) );
}
/* Constant, in milliseconds, used to calculate the total time-out period for write operations.
For each write operation, this value is added to the product of the WriteTotalTimeoutMultiplier member and the number of bytes to be written. */
@@ -883,6 +884,6 @@ HB_CALL_ON_STARTUP_END( _hb_wincom_init_ )
#if defined( HB_PRAGMA_STARTUP )
#pragma startup _hb_wincom_init_
#elif defined( HB_DATASEG_STARTUP )
#define HB_DATASEG_BODY HB_DATASEG_FUNC( _hb_wincom_init_ )
#define HB_DATASEG_BODY HB_DATASEG_FUNC( _hb_wincom_init_ )
#include "hbiniseg.h"
#endif

View File

@@ -66,7 +66,7 @@
#include "hbapiitm.h"
#ifndef QS_ALLPOSTMESSAGE
#define QS_ALLPOSTMESSAGE 0x0100
#define QS_ALLPOSTMESSAGE 0x0100
#endif
HB_FUNC( WIN_RUNDETACHED )
@@ -87,26 +87,26 @@ HB_FUNC( WIN_RUNDETACHED )
#endif
if( CreateProcess(
HB_PARSTR( 1, &hCommandName, NULL ), /* Command name */
HB_STRUNSHARE( &hCommandLine, lpCommandRO, nLen ), /* Command line (Unicode version needs an non-const buffer) */
NULL, /* Process handle not inheritable */
NULL, /* Thread handle not inheritable */
FALSE, /* Set handle inheritance to FALSE */
HB_PARSTR( 1, &hCommandName, NULL ), /* Command name */
HB_STRUNSHARE( &hCommandLine, lpCommandRO, nLen ), /* Command line (Unicode version needs an non-const buffer) */
NULL, /* Process handle not inheritable */
NULL, /* Thread handle not inheritable */
FALSE, /* Set handle inheritance to FALSE */
#if ! defined( HB_OS_WIN_CE )
hb_parl( 4 ) ? CREATE_NO_WINDOW : CREATE_NEW_CONSOLE, /* Creation flags */
hb_parl( 4 ) ? CREATE_NO_WINDOW : CREATE_NEW_CONSOLE, /* Creation flags */
#else
CREATE_NEW_CONSOLE, /* Creation flags */
CREATE_NEW_CONSOLE, /* Creation flags */
#endif
NULL, /* Use parent's environment block */
NULL, /* Use parent's starting directory */
NULL, /* Use parent's environment block */
NULL, /* Use parent's starting directory */
#if ! defined( HB_OS_WIN_CE )
&si, /* Pointer to STARTUPINFO structure */
&pi ) /* Pointer to PROCESS_INFORMATION structure */
&si, /* Pointer to STARTUPINFO structure */
&pi ) /* Pointer to PROCESS_INFORMATION structure */
#else
NULL, /* Pointer to STARTUPINFO structure */
NULL ) /* Pointer to PROCESS_INFORMATION structure */
NULL, /* Pointer to STARTUPINFO structure */
NULL ) /* Pointer to PROCESS_INFORMATION structure */
#endif
)
)
{
hb_retl( HB_TRUE );
@@ -170,10 +170,10 @@ HB_FUNC( WIN_GETCOMMANDLINEPARAM )
/* Skip application path */
pos = 0;
while( lpCmdLine[ pos ] && ( fQuote || !HB_ISSPACE( lpCmdLine[ pos ] ) ) )
while( lpCmdLine[ pos ] && ( fQuote || ! HB_ISSPACE( lpCmdLine[ pos ] ) ) )
{
if( lpCmdLine[ pos ] == '"' )
fQuote = !fQuote;
fQuote = ! fQuote;
pos++;
}
while( HB_ISSPACE( lpCmdLine[ pos ] ) )
@@ -280,17 +280,13 @@ HB_FUNC( WIN_SYSREFRESH )
switch( msg.message )
{
case WM_CLOSE:
{
CloseHandle( hDummyEvent );
hb_retni( 1 );
return;
}
case WM_QUIT:
{
CloseHandle( hDummyEvent );
hb_retnint( msg.wParam );
return;
}
#if 0
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
@@ -321,7 +317,7 @@ HB_FUNC( WIN_QPCOUNTER2SEC )
if( s_dFrequence == 0 )
{
LARGE_INTEGER frequency;
if( !QueryPerformanceFrequency( &frequency ) )
if( ! QueryPerformanceFrequency( &frequency ) )
{
hb_retnd( 0 );
return;

View File

@@ -62,6 +62,7 @@ static void getwinver( OSVERSIONINFO * pOSvi )
HB_FUNC( WIN_OSISNT )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT );
}
@@ -69,6 +70,7 @@ HB_FUNC( WIN_OSISNT )
HB_FUNC( WIN_OSISNT351 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
osvi.dwMajorVersion == 3 && osvi.dwMinorVersion == 51 );
@@ -77,6 +79,7 @@ HB_FUNC( WIN_OSISNT351 )
HB_FUNC( WIN_OSISNT4 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0 );
@@ -85,6 +88,7 @@ HB_FUNC( WIN_OSISNT4 )
HB_FUNC( WIN_OSIS2000ORUPPER )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion >= 5 );
}
@@ -92,6 +96,7 @@ HB_FUNC( WIN_OSIS2000ORUPPER )
HB_FUNC( WIN_OSIS2000 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 );
}
@@ -99,6 +104,7 @@ HB_FUNC( WIN_OSIS2000 )
HB_FUNC( WIN_OSISXP )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 );
}
@@ -106,6 +112,7 @@ HB_FUNC( WIN_OSISXP )
HB_FUNC( WIN_OSISWINXPORUPPER )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion > 5 || ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion >= 1 ) );
}
@@ -113,6 +120,7 @@ HB_FUNC( WIN_OSISWINXPORUPPER )
HB_FUNC( WIN_OSIS2003 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 );
}
@@ -120,6 +128,7 @@ HB_FUNC( WIN_OSIS2003 )
HB_FUNC( WIN_OSISVISTA )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 );
}
@@ -127,6 +136,7 @@ HB_FUNC( WIN_OSISVISTA )
HB_FUNC( WIN_OSISVISTAORUPPER )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion >= 6 );
}
@@ -134,6 +144,7 @@ HB_FUNC( WIN_OSISVISTAORUPPER )
HB_FUNC( WIN_OSIS7 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 );
}
@@ -141,6 +152,7 @@ HB_FUNC( WIN_OSIS7 )
HB_FUNC( WIN_OSIS8 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2 );
}
@@ -148,6 +160,7 @@ HB_FUNC( WIN_OSIS8 )
HB_FUNC( WIN_OSIS9X )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS );
}
@@ -155,6 +168,7 @@ HB_FUNC( WIN_OSIS9X )
HB_FUNC( WIN_OSIS95 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0 );
@@ -163,6 +177,7 @@ HB_FUNC( WIN_OSIS95 )
HB_FUNC( WIN_OSIS98 )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10 );
@@ -171,6 +186,7 @@ HB_FUNC( WIN_OSIS98 )
HB_FUNC( WIN_OSISME )
{
OSVERSIONINFO osvi;
getwinver( &osvi );
hb_retl( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90 );
@@ -180,12 +196,13 @@ HB_FUNC( WIN_OSISTSCLIENT )
{
HB_BOOL bResult = HB_FALSE;
OSVERSIONINFO osvi;
getwinver( &osvi );
if( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 4 )
{
/* Only supported on NT 4.0 SP3 & higher */
#ifndef SM_REMOTESESSION
#define SM_REMOTESESSION 0x1000
#define SM_REMOTESESSION 0x1000
#endif
bResult = ( GetSystemMetrics( SM_REMOTESESSION ) != 0 );
}

View File

@@ -64,7 +64,7 @@
etc....
Peter Rees 21 January 2004 <peter@rees.co.nz>
*/
*/
#include "hbwin.h"
#include "hbwapi.h"
@@ -77,7 +77,7 @@
#if defined( __POCC__ )
#ifndef FONTENUMPROC
#define FONTENUMPROC FONTENUMPROCW
#define FONTENUMPROC FONTENUMPROCW
#endif
#endif
#else
@@ -663,9 +663,9 @@ HB_FUNC( WIN_FILLRECT )
HBRUSH hBrush = CreateSolidBrush( ( COLORREF ) hb_parnl( 6 ) );
RECT rct;
rct.left = hb_parnl( 2 );
rct.top = hb_parnl( 3 );
rct.right = hb_parnl( 4 );
rct.left = hb_parnl( 2 );
rct.top = hb_parnl( 3 );
rct.right = hb_parnl( 4 );
rct.bottom = hb_parnl( 5 );
if( FillRect( hDC, &rct, hBrush ) )
@@ -688,12 +688,12 @@ HB_FUNC( WIN_LINETO )
HB_FUNC( WIN_RECTANGLE )
{
HDC hDC = hbwapi_par_HDC( 1 );
int x1 = hb_parni( 2 );
int y1 = hb_parni( 3 );
int x2 = hb_parni( 4 );
int y2 = hb_parni( 5 );
int iWidth = hb_parni( 6 );
HDC hDC = hbwapi_par_HDC( 1 );
int x1 = hb_parni( 2 );
int y1 = hb_parni( 3 );
int x2 = hb_parni( 4 );
int y2 = hb_parni( 5 );
int iWidth = hb_parni( 6 );
int iHeight = hb_parni( 7 );
if( iWidth && iHeight )

View File

@@ -60,7 +60,7 @@
#include <winspool.h>
#endif
#define _ENUMPRN_FLAGS_ ( PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS )
#define _ENUMPRN_FLAGS_ ( PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS )
#if ! defined( HB_OS_WIN_CE )
static HB_BOOL hb_IsLegacyDevice( const char * pszPrinterName )
@@ -187,7 +187,7 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName )
If Level is 2 or 5, Name is a pointer to a null-terminated string that specifies
the name of a server whose printers are to be enumerated.
If this string is NULL, then the function enumerates the printers installed on the local machine.
*/
*/
DWORD dwNeeded = 0, dwReturned = 0;
if( EnumPrinters( PRINTER_ENUM_DEFAULT, NULL, 2, NULL, 0, &dwNeeded, &dwReturned ) )
@@ -422,9 +422,9 @@ HB_FUNC( WIN_PRINTFILERAW )
while( nWritten < nRead )
{
DWORD dwWritten = 0;
if( !WritePrinter( hPrinter, &pbyBuffer[ nWritten ],
( DWORD ) ( nRead - nWritten ),
&dwWritten ) )
if( ! WritePrinter( hPrinter, &pbyBuffer[ nWritten ],
( DWORD ) ( nRead - nWritten ),
&dwWritten ) )
{
iResult = -7;
break;
@@ -470,17 +470,18 @@ HB_FUNC( WIN_PRINTFILERAW )
/* Positions for WIN_PRINTERLIST() array */
#define HB_WINPRN_NAME 1
#define HB_WINPRN_PORT 2
#define HB_WINPRN_TYPE 3
#define HB_WINPRN_DRIVER 4
#define HB_WINPRN_SHARE 5
#define HB_WINPRN_SERVER 6
#define HB_WINPRN_LEN_ 6
#define HB_WINPRN_NAME 1
#define HB_WINPRN_PORT 2
#define HB_WINPRN_TYPE 3
#define HB_WINPRN_DRIVER 4
#define HB_WINPRN_SHARE 5
#define HB_WINPRN_SERVER 6
#define HB_WINPRN_LEN_ 6
HB_FUNC( WIN_PRINTERLIST )
{
PHB_ITEM pPrinterArray = hb_itemArrayNew( 0 );
#if ! defined( HB_OS_WIN_CE )
HB_BOOL bPrinterNamesOnly = ! hb_parl( 1 );
HB_BOOL bLocalPrintersOnly = hb_parl( 2 );

View File

@@ -111,8 +111,8 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName )
return HB_FALSE;
}
/* Tell all open programs that this change occurred.
Allow each program 1 second to handle this message. */
/* Tell all open programs that this change occurred.
Allow each program 1 second to handle this message. */
SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0L, ( LPARAM ) ( LPCTSTR ) TEXT( "windows" ), SMTO_NORMAL, 1000, NULL );
}
/* If Windows NT, use the SetDefaultPrinter API for Windows 2000,
@@ -140,7 +140,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName )
return HB_FALSE;
}
bFlag = ( * fnSetDefaultPrinter )( lpPrinterName );
bFlag = ( *fnSetDefaultPrinter )( lpPrinterName );
FreeLibrary( hWinSpool );
if( ! bFlag )
return HB_FALSE;

View File

@@ -57,20 +57,20 @@ static HKEY hb_regkeyconv( HB_PTRUINT nKey )
{
switch( nKey )
{
case 1:
return ( HKEY ) HKEY_CLASSES_ROOT;
/* NOTE: In xhb, zero value means HKEY_LOCAL_MACHINE. */
case 0:
case 2:
return ( HKEY ) HKEY_CURRENT_USER;
case 1:
return ( HKEY ) HKEY_CLASSES_ROOT;
/* NOTE: In xhb, zero value means HKEY_LOCAL_MACHINE. */
case 0:
case 2:
return ( HKEY ) HKEY_CURRENT_USER;
#if ! defined( HB_OS_WIN_CE )
case 3:
return ( HKEY ) HKEY_CURRENT_CONFIG;
case 3:
return ( HKEY ) HKEY_CURRENT_CONFIG;
#endif
case 4:
return ( HKEY ) HKEY_LOCAL_MACHINE;
case 5:
return ( HKEY ) HKEY_USERS;
case 4:
return ( HKEY ) HKEY_LOCAL_MACHINE;
case 5:
return ( HKEY ) HKEY_USERS;
}
return ( HKEY ) nKey;
@@ -144,7 +144,7 @@ HB_FUNC( WIN_REGQUERYVALUEEX )
&dwSize ) == ERROR_SUCCESS )
{
#if defined( UNICODE )
dwSize >>= 1;
dwSize >>= 1;
#endif
HB_STORSTRLEN( ( LPTSTR ) lpValue, dwSize, 5 );
@@ -226,7 +226,7 @@ HB_FUNC( WIN_REGSETVALUEEX )
++nValueLen;
#if defined( UNICODE )
nValueLen *= 2;
nValueLen *= 2;
#endif
hb_retl( RegSetValueEx( ( HKEY ) hb_parptr( 1 ),

View File

@@ -57,15 +57,15 @@
# include <rpc.h>
#endif
HB_FUNC( WIN_UUIDCREATESTRING )
HB_FUNC( WIN_UUIDCREATESTRING )
{
#if ! defined( HB_OS_WIN_CE )
typedef RPC_STATUS ( RPC_ENTRY * _HB_UUIDCREATE )( UUID * );
typedef RPC_STATUS ( RPC_ENTRY * _HB_UUIDTOSTRING )( UUID *, unsigned char ** );
typedef RPC_STATUS ( RPC_ENTRY * _HB_RPCSTRINGFREE )( unsigned char ** );
static _HB_UUIDCREATE s_pUuidCreate = NULL;
static _HB_UUIDTOSTRING s_pUuidToString = NULL;
static _HB_UUIDCREATE s_pUuidCreate = NULL;
static _HB_UUIDTOSTRING s_pUuidToString = NULL;
static _HB_RPCSTRINGFREE s_pRpcStringFree = NULL;
if( ! s_pUuidCreate )

View File

@@ -52,13 +52,13 @@
*/
#undef _WIN32_IE
#define _WIN32_IE 0x0500 /* request Windows 2000 features for NOTIFYICONDATA */
#define _WIN32_IE 0x0500 /* request Windows 2000 features for NOTIFYICONDATA */
#include "hbwapi.h"
#include "hbapiitm.h"
#if defined( __BORLANDC__ )
# if !defined( NONAMELESSUNION )
# if ! defined( NONAMELESSUNION )
# define NONAMELESSUNION
# endif
# if defined( DUMMYUNIONNAME )
@@ -81,9 +81,9 @@
#include <shellapi.h>
#if defined( NONAMELESSUNION )
# define HB_WIN_V_UNION( x, z ) ((x).DUMMYUNIONNAME.z)
# define HB_WIN_V_UNION( x, z ) ( ( x ).DUMMYUNIONNAME.z )
#else
# define HB_WIN_V_UNION( x, z ) ((x).z)
# define HB_WIN_V_UNION( x, z ) ( ( x ).z )
#endif
/* WIN_ShellNotifyIcon( [<hWnd>], [<nUID>], [<nMessage>], [<hIcon>],
@@ -109,7 +109,7 @@ HB_FUNC( WIN_SHELLNOTIFYICON )
tnid.uFlags |= NIF_TIP;
#if defined( NIF_INFO ) /* did the headers provide Windows 2000 features? */
if( hb_iswin2k() ) /* are we running on Windows 2000 or above? */
if( hb_iswin2k() ) /* are we running on Windows 2000 or above? */
{
if( HB_ITEMCOPYSTR( hb_param( 7, HB_IT_ANY ), tnid.szInfo, HB_SIZEOFARRAY( tnid.szInfo ) ) > 0 )
tnid.uFlags |= NIF_INFO;
@@ -130,7 +130,7 @@ HB_FUNC( WIN_SHELLNOTIFYICON )
/* Details:
http://msdn.microsoft.com/en-us/library/bb762164(VS.85).aspx
http://msdn.microsoft.com/en-us/library/bb759795(v=VS.85).aspx
*/
*/
#if ! defined( HB_OS_WIN_CE )
@@ -218,6 +218,7 @@ static LPTSTR s_StringList( int iParam )
HB_FUNC( WIN_SHFILEOPERATION )
{
int iRetVal;
#if defined( HB_OS_WIN_CE )
iRetVal = -1;
#else

View File

@@ -132,17 +132,17 @@ static VOID WINAPI hbwin_SvcMainFunction( DWORD dwArgc, LPTSTR * lpszArgv )
}
else
{
HB_TRACE( HB_TR_DEBUG, ("HVM stack not available") );
HB_TRACE( HB_TR_DEBUG, ( "HVM stack not available" ) );
}
}
else
{
HB_TRACE( HB_TR_DEBUG, ("Harbour service entry function not found") );
HB_TRACE( HB_TR_DEBUG, ( "Harbour service entry function not found" ) );
}
}
else
{
HB_TRACE( HB_TR_DEBUG, ("Error registering service") );
HB_TRACE( HB_TR_DEBUG, ( "Error registering service" ) );
}
}
@@ -218,20 +218,20 @@ HB_FUNC( WIN_SERVICEINSTALL )
LPCTSTR lpServiceName = HB_PARSTRDEF( 1, &hServiceName, NULL );
LPCTSTR lpDisplayName = HB_PARSTRDEF( 2, &hDisplayName, NULL );
schSrv = CreateService( schSCM, /* SCM database */
lpServiceName, /* name of service */
lpDisplayName, /* service name to display */
SERVICE_ALL_ACCESS, /* desired access */
SERVICE_WIN32_OWN_PROCESS, /* service type */
schSrv = CreateService( schSCM, /* SCM database */
lpServiceName, /* name of service */
lpDisplayName, /* service name to display */
SERVICE_ALL_ACCESS, /* desired access */
SERVICE_WIN32_OWN_PROCESS, /* service type */
HB_ISNUM( 4 ) ? ( DWORD ) hb_parnl( 4 ) : SERVICE_DEMAND_START,
/* start type */
SERVICE_ERROR_NORMAL, /* error control type */
lpPath, /* path to service's binary */
NULL, /* no load ordering group */
NULL, /* no tag identifier */
NULL, /* no dependencies */
NULL, /* LocalSystem account */
NULL ); /* no password */
/* start type */
SERVICE_ERROR_NORMAL, /* error control type */
lpPath, /* path to service's binary */
NULL, /* no load ordering group */
NULL, /* no tag identifier */
NULL, /* no dependencies */
NULL, /* LocalSystem account */
NULL ); /* no password */
if( schSrv )
{
@@ -260,6 +260,7 @@ HB_FUNC( WIN_SERVICEINSTALL )
HB_FUNC( WIN_SERVICEDELETE )
{
HB_BOOL bRetVal = HB_FALSE;
#if ! defined( HB_OS_WIN_CE )
SC_HANDLE schSCM = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
@@ -295,6 +296,7 @@ HB_FUNC( WIN_SERVICEDELETE )
HB_FUNC( WIN_SERVICESTART )
{
HB_BOOL bRetVal = HB_FALSE;
#if ! defined( HB_OS_WIN_CE )
PHB_ITEM pEntryFunc;

View File

@@ -483,8 +483,8 @@
array <aTarget> remains constant.
$EXAMPLES$
LOCAL nCount := 2, nStart := 1, aOne, aTwo
aOne := { "HARBOUR", " is ", "POWER"}
aTwo := { "CLIPPER", " was ", "POWER"}
aOne := { "HARBOUR", " is ", "POWER" }
aTwo := { "CLIPPER", " was ", "POWER" }
ACopy( aOne, aTwo, nStart, nCount )
$STATUS$
R
@@ -522,7 +522,7 @@
original array <aSource>
$EXAMPLES$
LOCAL aOne, aTwo
aOne := { "Harbour"," is ","POWER" }
aOne := { "Harbour", " is ", "POWER" }
aTwo := AClone( aOne ) // Result: aTwo is {"Harbour"," is ","POWER"}
aOne[ 1 ] := "The Harbour Compiler"
// Result:

View File

@@ -304,7 +304,7 @@
FWrite( nHandle, cDay , 1 )
FClose( nHandle )
USE test
? "New update date is:", lupdate()
? "New update date is:", LUpdate()
CLOSE
ELSE
? "Can not open file"

View File

@@ -307,18 +307,18 @@
VAR hWnd, nOldProc
METHOD New( ) CONSTRUCTOR
METHOD Capture() INLINE SetCapture( ::hWnd )
METHOD End() BLOCK {| Self, lEnd | iif( lEnd := ::lValid(),;
::PostMsg( WM_CLOSE ), ), lEnd }
METHOD End() BLOCK {| Self, lEnd | iif( lEnd := ::lValid(), ;
::PostMsg( WM_CLOSE ), ), lEnd }
METHOD EraseBkGnd( hDC )
METHOD cTitle( cNewTitle ) SETGET
METHOD Close() VIRTUAL
ENDCLASS
METHOD New( ) CLASS TWindow
local nVar, cStr
LOCAL nVar, cStr
... <code> ...
... <code> ...
RETURN Self
RETURN Self
$TESTS$
TestOp.prg
$STATUS$

View File

@@ -36,8 +36,8 @@
If a NULL date is passed to the function, the value of the function
will be a NULL byte.
$EXAMPLES$
? CDOW( Date() )
IF CDOW( Date() + 10 ) == "Sunday"
? CDoW( Date() )
IF CDoW( Date() + 10 ) == "Sunday"
? "This is a sunny day."
ENDIF
$STATUS$
@@ -77,7 +77,7 @@
will be a NULL byte.
$EXAMPLES$
? CMonth( Date() )
IF CMonth( Date() + 10 ) =="March"
IF CMonth( Date() + 10 ) == "March"
? "Have you done your system BACKUP?"
ENDIF
$STATUS$
@@ -115,7 +115,7 @@
$EXAMPLES$
? Date()
$TESTS$
? "Today is ",Day(Date())," of ",cMonth(Date())," of ",Year(Date())
? "Today is ", Day( Date() ), " of ", CMonth( Date() ), " of ", Year( Date() )
$STATUS$
R
$COMPLIANCE$
@@ -261,8 +261,8 @@
This function returns the number representing the day of the week
for the date expressed as <dDate>.
$EXAMPLES$
? DOW( Date() )
? DOW( Date() - 6584 )
? DoW( Date() )
? DoW( Date() - 6584 )
$STATUS$
R
$COMPLIANCE$

View File

@@ -67,7 +67,7 @@
// Copy delinquent accounts into a delimited text file.
USE ACCOUNTS NEW
COPY TO overdue DELIMITED FOR !Empty( accounts->duedate ) ;
.AND. DATE() - accounts->duedate > 30
.AND. Date() - accounts->duedate > 30
// Import new customer records.
USE CUSTOMER NEW
APPEND FROM customer DELIMITED

View File

@@ -62,7 +62,7 @@
// Copy delinquent accounts into an SDF text file.
USE ACCOUNTS NEW
COPY TO overdue SDF FOR !Empty( accounts->duedate ) ;
.AND. DATE() - accounts->duedate > 30
.AND. Date() - accounts->duedate > 30
// Import new customer records.
USE CUSTOMER NEW
APPEND FROM customer SDF

View File

@@ -48,14 +48,14 @@
function during compile time.
$EXAMPLES$
// Create a new file that contain the same structure
USE TEST
__dbCopyStruct( "mycopy.dbf" )
USE TEST
__dbCopyStruct( "mycopy.dbf" )
// Create a new file that contain part of the original structure
LOCAL aList
USE TEST
aList := { "NAME" }
__dbCopyStruct( "onlyname.dbf", aList )
// Create a new file that contain part of the original structure
LOCAL aList
USE TEST
aList := { "NAME" }
__dbCopyStruct( "onlyname.dbf", aList )
$STATUS$
R
$COMPLIANCE$
@@ -102,12 +102,12 @@
function during compile time.
$EXAMPLES$
// Create a new file that contains the same structure
USE TEST
COPY STRUCTURE TO MyCopy
USE TEST
COPY STRUCTURE TO MyCopy
// Create a new file that contains part of the original structure
USE TEST
COPY STRUCTURE TO SomePart FIELDS name, address
// Create a new file that contains part of the original structure
USE TEST
COPY STRUCTURE TO SomePart FIELDS name, address
$STATUS$
R
$COMPLIANCE$
@@ -669,10 +669,11 @@
SET EXACT has no effect on the return value.
$EXAMPLES$
LOCAL aStruct, aList, aRet
aStruct := { { "CODE", "N", 4, 0 }, ;
{ "NAME", "C", 10, 0 }, ;
{ "PHONE", "C", 13, 0 }, ;
{ "IQ", "N", 3, 0 } }
aStruct := { ;
{ "CODE", "N", 4, 0 }, ;
{ "NAME", "C", 10, 0 }, ;
{ "PHONE", "C", 13, 0 }, ;
{ "IQ", "N", 3, 0 } }
aList := { "IQ", "NAME" }
aRet := __dbStructFilter( aStruct, aList )
// { { "IQ", "N", 3, 0 }, { "NAME", "C", 10, 0 } }

View File

@@ -539,7 +539,7 @@
cB := cLine
ELSE
cB := SubStr( cLine, 1, nEol - 1 )
FSEEK( nH, nSavePos + nEol + 1, FS_SET )
FSeek( nH, nSavePos + nEol + 1, FS_SET )
ENDIF
RETURN nNumRead != 0
$STATUS$
@@ -918,7 +918,7 @@
directory is the root, the value of the function will be a NULL
byte.
$EXAMPLES$
? Curdir()
? CurDir()
$STATUS$
R
$COMPLIANCE$

View File

@@ -210,7 +210,7 @@
PROCEDURE Test( xExp )
IF PCount() == 0
? "This function needs a parameter"
ELS
ELSE
? xExp
ENDIF
RETURN

View File

@@ -97,7 +97,7 @@
DO WHILE Inkey( 0.1 ) != K_ESC
ENDDO
$TESTS$
KEYBOARD "AB"; ? Inkey(), Inkey() ==> 65 66
KEYBOARD "AB"; ? Inkey(), Inkey() // ==> 65 66
$STATUS$
S
$COMPLIANCE$
@@ -143,9 +143,9 @@
// Clear the keyboard buffer
CLEAR TYPEAHEAD
$TESTS$
KEYBOARD Chr( 13 ); ? Inkey() ==> 13
KEYBOARD ";" ? Inkey() ==> 13
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() ==> 0
KEYBOARD Chr( 13 ); ? Inkey() // ==> 13
KEYBOARD ";" ? Inkey() // ==> 13
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
$STATUS$
R
$COMPLIANCE$
@@ -185,8 +185,8 @@
// Stuff an Alt+PgDn key into the keyboard buffer
hb_keyPut( K_ALT_PGDN )
$TESTS$
hb_keyPut( K_ALT_PGDN ) ; ? INKEY() ==> 417
hb_keyPut( K_F11 ) ; ? INKEY() ==> -40
hb_keyPut( K_ALT_PGDN ) ; ? INKEY() // ==> 417
hb_keyPut( K_F11 ) ; ? INKEY() // ==> -40
$STATUS$
R
$COMPLIANCE$
@@ -237,7 +237,7 @@
ENDIF
ENDDO
$TESTS$
KEYBOARD "AB"; ? NextKey(), NextKey() ==> 65 65
KEYBOARD "AB"; ? NextKey(), NextKey() // ==> 65 65
$STATUS$
R
$COMPLIANCE$
@@ -282,7 +282,7 @@
ENDIF
ENDDO
$TESTS$
KEYBOARD "AB"; ? INKEY(), LASTKEY() ==> 65 65
KEYBOARD "AB"; ? INKEY(), LASTKEY() // ==> 65 65
$STATUS$
R
$COMPLIANCE$
@@ -328,8 +328,8 @@
// Clear the keyboard buffer
CLEAR TYPEAHEAD
$TESTS$
KEYBOARD Chr( 13 ); ? Inkey() ==> 13
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() ==> 0
KEYBOARD Chr( 13 ); ? Inkey() // ==> 13
KEYBOARD "HELLO"; CLEAR TYPEAHEAD; ? Inkey() // ==> 0
$STATUS$
R
$COMPLIANCE$

View File

@@ -44,10 +44,10 @@
REQUEST HB_LANG_ES
PROCEDURE Main()
// English: Argument error
? "English:", HB_LANGERRMSG( EG_ARG )
"ES" )
? "English:", hb_langErrMsg( EG_ARG )
hb_langSelect( "ES" )
// Spanish: Error de argumento
? "Spanish:", HB_LANGERRMSG( EG_ARG )
? "Spanish:", hb_langErrMsg( EG_ARG )
RETURN
$STATUS$
R
@@ -91,10 +91,10 @@
REQUEST HB_LANG_ES
PROCEDURE Main()
// English: Monday
? "English:", HB_LANGMESSAGE( HB_LANG_ITEM_BASE_DAY + 1 )
"ES" )
? "English:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 )
hb_langSelect( "ES" )
// Spanish: Lunes
? "Spanish:", HB_LANGMESSAGE( HB_LANG_ITEM_BASE_DAY + 1 )
? "Spanish:", hb_langMessage( HB_LANG_ITEM_BASE_DAY + 1 )
RETURN
$STATUS$
R
@@ -135,16 +135,16 @@
REQUEST HB_LANG_ES
PROCEDURE Main()
hb_langSelect( "pt" ) // Default language is now Portuguese
? CDOW( Date() ) //Segunda-feira
? CDoW( Date() ) //Segunda-feira
? "Current language is ", hb_langName() // Portuguese
? "Old language id selected is ", hb_langSelect() // PT
hb_langSelect( "ro" ) // Default language is now Romanian
? CMONTH( Date() ) // Mai
? CMonth( Date() ) // Mai
? "Old language id selected is ", hb_langSelect() // RO
hb_langSelect( "es" ) // Default language is now Spanish
? "Current language is ",hb_langName() // Spanish
? CMONTH( Date() ) // Mayo
? CDOW( Date() ) // Lunes
? "Current language is ", hb_langName() // Spanish
? CMonth( Date() ) // Mayo
? CDoW( Date() ) // Lunes
RETURN
$TESTS$
See tests/langapi.prg, tests/langmsg.prg
@@ -235,15 +235,15 @@
REQUEST HB_LANG_RO
REQUEST HB_LANG_ES
PROCEDURE Main()
HB_LANGSELECT( "pt" ) // Default language is now Portuguese
? CDOW( Date() ) // Segunda-feira
? "Old language id selected is ", HB_LANGSELECT() // PT
HB_LANGSELECT( "ro" ) // Default language is now Romanian
? CMONTH( Date() ) // Mai
? "Old language id selected is ", HB_LANGSELECT() // RO
HB_LANGSELECT( "es" ) // Default language is now Spanish
? CMONTH( Date() ) // Mayo
? CDOW( Date() ) // Lunes
hb_langSelect( "pt" ) // Default language is now Portuguese
? CDoW( Date() ) // Segunda-feira
? "Old language id selected is ", hb_langSelect() // PT
hb_langSelect( "ro" ) // Default language is now Romanian
? CMonth( Date() ) // Mai
? "Old language id selected is ", hb_langSelect() // RO
hb_langSelect( "es" ) // Default language is now Spanish
? CMonth( Date() ) // Mayo
? CDoW( Date() ) // Lunes
RETURN
$TESTS$
See tests/langapi.prg, tests/langmsg.prg

View File

@@ -67,8 +67,8 @@
$EXAMPLES$
INIT PROCEDURE IWANTCLIPPER()
HB_SETMACRO( HB_SM_HARBOUR, .F. )
HB_SETMACRO( HB_SM_XBASE, .F. )
hb_SetMacro( HB_SM_HARBOUR, .F. )
hb_SetMacro( HB_SM_XBASE, .F. )
RETURN
$STATUS$
R

View File

@@ -46,9 +46,9 @@
? nNumber - nNumber1
? nNumber1 - nNumber
? ABS( nNumber - nNumber1 )
? ABS( nNumber1 - nNumber )
? ABS( -1 * 345 )
? Abs( nNumber - nNumber1 )
? Abs( nNumber1 - nNumber )
? Abs( -1 * 345 )
$STATUS$
R
$COMPLIANCE$
@@ -83,7 +83,7 @@
This function returns the value of e raised to the power of
<nNumber>. It is the inverse of LOG().
$EXAMPLES$
? EXP(45)
? Exp( 45 )
$STATUS$
R
$COMPLIANCE$
@@ -121,8 +121,8 @@
point.
$EXAMPLES$
SET DECIMAL TO 5
? INT( 632512.62541 )
? INT( 845414111.91440 )
? Int( 632512.62541 )
? Int( 845414111.91440 )
$STATUS$
R
$COMPLIANCE$
@@ -159,7 +159,7 @@
which is depicted on the display device as a series of asterisks.
This function is the inverse of EXP().
$EXAMPLES$
? LOG( 632512 )
? Log( 632512 )
$STATUS$
R
$COMPLIANCE$
@@ -200,8 +200,8 @@
are date data types, the return value will be a date data type as
well. It will be the later of the two dates passed to it.
$EXAMPLES$
? MAX( 214514214, 6251242142 )
? MAX( STOD( "20001111" ), STOD( "20140621" ) )
? Max( 214514214, 6251242142 )
? Max( SToD( "20001111" ), SToD( "20140621" ) )
$STATUS$
R
$COMPLIANCE$
@@ -239,8 +239,8 @@
<xValue> and <xValue1> must be the same data type. If numeric, the
smaller number is returned. If dates, the earlier date is returned.
$EXAMPLES$
? MIN( 214514214, 6251242142 )
? MIN( STOD( "20001111" ), STOD( "20140621" ) )
? Min( 214514214, 6251242142 )
? Min( SToD( "20001111" ), SToD( "20140621" ) )
$STATUS$
R
$COMPLIANCE$
@@ -317,8 +317,8 @@
will always return a 0.
$EXAMPLES$
SET DECIMAL TO 5
? SQRT( 632512.62541 )
? SQRT( 845414111.91440 )
? Sqrt( 632512.62541 )
? Sqrt( 845414111.91440 )
$STATUS$
R
$COMPLIANCE$
@@ -358,8 +358,8 @@
whole numbers. Numbers from 5 through 9 will be rounded up, all
others will be rounded down.
$EXAMPLES$
? ROUND( 632512.62541, 5 )
? ROUND( 845414111.91440, 3 )
? Round( 632512.62541, 5 )
? Round( 845414111.91440, 3 )
$STATUS$
R
$COMPLIANCE$

View File

@@ -47,9 +47,9 @@
Returns a string/memo with carriage return chars converted to
specified chars.
$EXAMPLES$
? MEMOTRAN( DATA->CNOTES )
? MemoTran( DATA->CNOTES )
$TESTS$
@ 1, 1 SAY MEMOTRAN( Data->CNOTES )
@ 1, 1 SAY MemoTran( Data->CNOTES )
will display converted string starting on row two, column two of the
current device.
$STATUS$
@@ -84,9 +84,9 @@
Returns a string/memo with soft carriage return chars converted to
hard carriage return chars.
$EXAMPLES$
? HARDCR( Data->CNOTES )
? HardCR( Data->CNOTES )
$TESTS$
@ 1, 1 SAY HARDCR( Data->CNOTES )
@ 1, 1 SAY HardCR( Data->CNOTES )
will display converted string starting on row two, column two of the
current device.
$STATUS$
@@ -143,16 +143,16 @@
mode and shared. If the file is used in mode exclusive by another
process, the function will returns a null string ("").
$EXAMPLES$
* This example uses MEMOREAD() to assign the contents of a text
* file to a character variable for later search
// This example uses MEMOREAD() to assign the contents of a text
// file to a character variable for later search
cFile := "account.prg"
cString := MEMOREAD( cFile )
cCopyright := "Melina"
cFile := "account.prg"
cString := MemoRead( cFile )
cCopyright := "Melina"
IF At( "Melina", cString ) == 0 // check for copyright
MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
IF At( "Melina", cString ) == 0 // check for copyright
MemoWrit( cFile, cCopyright + cString ) // if not, add it!
ENDIF
$STATUS$
R
$COMPLIANCE$
@@ -213,16 +213,16 @@
HB_MEMOREAD() is identical to MEMOREAD() except it won't truncate the
last byte (on non-UNIX compatible systems) if it's a EOF char.
$EXAMPLES$
* This example uses HB_MEMOREAD() to assign the contents of a text
* file to a character variable for later search
// This example uses HB_MEMOREAD() to assign the contents of a text
// file to a character variable for later search
cFile := "account.prg"
cString := HB_MEMOREAD( cFile )
cCopyright := "Melina"
cFile := "account.prg"
cString := hb_MemoRead( cFile )
cCopyright := "Melina"
IF At( "Melina", cString ) == 0 // check for copyright
HB_MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
IF At( "Melina", cString ) == 0 // check for copyright
hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it!
ENDIF
$STATUS$
R
$COMPLIANCE$
@@ -275,15 +275,15 @@
Note that MEMOWRIT() do not use the directory settings SET DEFAULT.
$EXAMPLES$
* This example uses MEMOWRIT() to write the contents of a character
variable to a text file.
// This example uses MEMOWRIT() to write the contents of a character
// variable to a text file.
cFile := "account.prg"
cString := MEMOREAD( cFile )
cFile := "account.prg"
cString := MemoRead( cFile )
IF At( "Melina", cString ) == 0 // check for copyright
MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
IF At( "Melina", cString ) == 0 // check for copyright
MemoWrit( cFile, cCopyright + cString ) // if not, add it!
ENDIF
$STATUS$
R
$COMPLIANCE$
@@ -348,16 +348,16 @@
HB_MEMOWRIT() vs MEMOWRIT():
HB_MEMOWRIT() never writes the obsolete EOF char at the end of the file.
$EXAMPLES$
* This example uses HB_MEMOWRIT() to write the contents of a character
* variable to a text file.
// This example uses HB_MEMOWRIT() to write the contents of a character
// variable to a text file.
cFile := "account.prg"
cString := HB_MEMOREAD( cFile )
cCopyright := "Melina"
cFile := "account.prg"
cString := hb_MemoRead( cFile )
cCopyright := "Melina"
IF At( "Melina", cString ) == 0 // check for copyright
HB_MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
IF At( "Melina", cString ) == 0 // check for copyright
hb_MemoWrit( cFile, cCopyright + cString ) // if not, add it!
ENDIF
$STATUS$
R
$COMPLIANCE$

View File

@@ -102,8 +102,8 @@
n := iif( lVar, "A", 3 )
n := 2
n := "a"
n := seconds() + 2
n := int( seconds() + 2 )
n := Seconds() + 2
n := Int( Seconds() + 2 )
RETURN
$TESTS$
See tests/testwarn.prg for more examples
@@ -154,8 +154,8 @@
n := iif( lVar, "A", 3 )
n := 2
n := "a"
n := seconds() + 2
n := int( seconds() + 2 )
n := Seconds() + 2
n := Int( Seconds() + 2 )
y := n
? y
RETURN

View File

@@ -292,10 +292,10 @@
CLS
SET MESSAGE TO MaxRow() / 2 CENTER
SET WRAP ON
@ 0 , 0 PROMPT "1. Upper left" MESSAGE " One "
@ 0 , MaxCol()-16 PROMPT "2. Upper right" MESSAGE " Two "
@ MaxRow() - 1, MaxCol()-16 PROMPT "3. Bottom right" MESSAGE "Three"
@ MaxRow() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four "
@ 0 , 0 PROMPT "1. Upper left" MESSAGE " One "
@ 0 , MaxCol() - 16 PROMPT "2. Upper right" MESSAGE " Two "
@ MaxRow() - 1, MaxCol() - 16 PROMPT "3. Bottom right" MESSAGE "Three"
@ MaxRow() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four "
MENU TO nChoice
SetPos( MaxRow() / 2, MaxCol() / 2 - 10 )
IF nChoice == 0

View File

@@ -63,7 +63,7 @@
$DESCRIPTION$
This function returns the current Harbour Version.
$EXAMPLES$
? VERSION() // "Harbour Terminal: Standard stream console"
? Version() // "Harbour Terminal: Standard stream console"
$TESTS$
$STATUS$
@@ -104,9 +104,9 @@
If no environment variable
is found, an empty string is returned.
$EXAMPLES$
? GETENV( "PATH" )
? GETENV( "CONFIG" )
? GETENV( "HARBOURCMD", "-n -l -es2" )
? GetEnv( "PATH" )
? GetEnv( "CONFIG" )
? GetEnv( "HARBOURCMD", "-n -l -es2" )
$TESTS$
$STATUS$
@@ -147,9 +147,9 @@
If no environment variable
is found, an empty string is returned.
$EXAMPLES$
? GETE( "PATH" )
? GETE( "CONFIG" )
? GETE( "HARBOURCMD", "-n -l -es2" )
? GetE( "PATH" )
? GetE( "CONFIG" )
? GetE( "HARBOURCMD", "-n -l -es2" )
$TESTS$
$STATUS$
@@ -202,9 +202,9 @@
can be found, the value of the function will be <cDefaultValue>
if it is passed, else an empty string.
$EXAMPLES$
? HB_GETENV( "PATH" )
? HB_GETENV( "CONFIG" )
? HB_GETENV( "HARBOURCMD", "-n -l -es2" )
? hb_GetEnv( "PATH" )
? hb_GetEnv( "CONFIG" )
? hb_GetEnv( "HARBOURCMD", "-n -l -es2" )
$TESTS$
$STATUS$
@@ -289,23 +289,23 @@
is limited to the range 0 to 32767 Hz.
$EXAMPLES$
IF lOk // Good Sound
TONE( 500, 1 )
TONE( 4000, 1 )
TONE( 2500, 1 )
Tone( 500, 1 )
Tone( 4000, 1 )
Tone( 2500, 1 )
ELSE // Bad Sound
TONE( 300, 1 )
TONE( 499, 5 )
TONE( 700, 5 )
Tone( 300, 1 )
Tone( 499, 5 )
Tone( 700, 5 )
ENDIF
$TESTS$
TONE( 800, 1 ) // same as ? CHR( 7 )
TONE( 32000, 200 ) // any dogs around yet?
TONE( 130.80, 1 ) // musical note - C
TONE( 400, 0 ) // short beep
TONE( 700 ) // short beep
TONE( 10, 18.2 ) // 1 second delay
TONE( -1 ) // 1/18.2 second delay
TONE( ) // 1/18.2 second delay
Tone( 800, 1 ) // same as ? CHR( 7 )
Tone( 32000, 200 ) // any dogs around yet?
Tone( 130.80, 1 ) // musical note - C
Tone( 400, 0 ) // short beep
Tone( 700 ) // short beep
Tone( 10, 18.2 ) // 1 second delay
Tone( -1 ) // 1/18.2 second delay
Tone( ) // 1/18.2 second delay
$STATUS$
S
$COMPLIANCE$

View File

@@ -38,7 +38,7 @@
according to the msgxxx module used. </par>
$EXAMPLES$
// Wait until user enters Y
DO WHILE ! ISAFFIRM( cYesNo )
DO WHILE ! IsAffirm( cYesNo )
ACCEPT "Sure: " TO cYesNo
ENDDO
$STATUS$
@@ -75,7 +75,7 @@
according to the msgxxx module used. </par>
$EXAMPLES$
// Wait until user enters N
DO WHILE ! ISNEGATIVE( cYesNo )
DO WHILE ! IsNegative( cYesNo )
ACCEPT "Sure: " TO cYesNo
ENDDO
$STATUS$
@@ -113,8 +113,8 @@
$EXAMPLES$
// Displays "Sure Y/N: " and waits until user enters Y
// Y/N is the string for NATIONMSG( 12 ) with default natmsg module.
DO WHILE ! ISAFFIRM( cYesNo )
ACCEPT "Sure " + NATIONMSG( 12 ) + ": " TO cYesNo
DO WHILE ! IsAffirm( cYesNo )
ACCEPT "Sure " + NationMsg( 12 ) + ": " TO cYesNo
ENDDO
$STATUS$
C

View File

@@ -153,13 +153,13 @@
aClassData := __objGetMsgList( oB, .T., HB_MSGLISTCLASS )
aMethod := __objGetMsgList( oB, .F. )
FOR i := 1 TO Len( aData )
? "VAR name:", aData[ i ]
? "VAR name:", aData[ i ]
NEXT
FOR i := 1 TO Len( aClassData )
? "CLASS VAR name:", aClassData[ i ]
? "CLASS VAR name:", aClassData[ i ]
NEXT
FOR i := 1 TO Len( aMethod )
? "METHOD name:", aMethod[ i ]
? "METHOD name:", aMethod[ i ]
NEXT
$STATUS$
R
@@ -201,7 +201,7 @@
oB := TBrowseNew( 0, 0, 24, 79 )
aMethod := __objGetMethodList( oB )
FOR i := 1 TO Len( aMethod )
? "METHOD name:", aMethod[ i ]
? "METHOD name:", aMethod[ i ]
NEXT
$STATUS$
R
@@ -246,8 +246,8 @@
// show information about TBrowse class
oB := TBrowseNew( 0, 0, 24, 79 )
aData := __objGetValueList( oB )
FOR i := 1 TO len( aData )
? "VAR name:", aData[ i, HB_OO_DATA_SYMBOL ], ;
FOR i := 1 TO Len( aData )
? "VAR name:", aData[ i, HB_OO_DATA_SYMBOL ], ;
" value=", aData[ i, HB_OO_DATA_VALUE ]
NEXT
$STATUS$

View File

@@ -298,7 +298,7 @@
open work areas.
$EXAMPLES$
PROCEDURE Main()
LOCAL cName := SPACE( 40 )
LOCAL cName := Space( 40 )
LOCAL nId := 0
USE test EXCLUSIVE NEW
//
@@ -306,11 +306,11 @@
@ 11, 10 GET nId
READ
//
IF UPDATED()
IF Updated()
APPEND BLANK
REPLACE tests->Name WITH cName
REPLACE tests->Id WITH nId
tests->( DBCOMMIT() )
tests->( dbCommit() )
ENDIF
RETURN
$STATUS$
@@ -343,7 +343,7 @@
open work areas.
$EXAMPLES$
PROCEDURE Main()
LOCAL cName := SPACE( 40 )
LOCAL cName := Space( 40 )
LOCAL nId := 0
USE test EXCLUSIVE NEW
USE testid NEW INDEX testid
@@ -352,16 +352,16 @@
@ 11, 10 GET nId
READ
//
IF UPDATED()
IF Updated()
APPEND BLANK
REPLACE tests->Name WITH cName
REPLACE tests->Id WITH nId
IF ! testid->( DBSEEK( nId ) )
IF ! testid->( dbSeek( nId ) )
APPEND BLANK
REPLACE tests->Id WITH nId
ENDIF
ENDIF
DBCOMMITALL()
dbCommitAll()
RETURN
$STATUS$
R
@@ -443,13 +443,14 @@
database.
$EXAMPLES$
PROCEDURE Main()
LOCAL nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
{ "NUMERIC", "N", 8, 0 }, ;
{ "DOUBLE", "N", 8, 2 }, ;
{ "DATE", "D", 8, 0 }, ;
{ "LOGICAL", "L", 1, 0 }, ;
{ "MEMO1", "M", 10, 0 }, ;
{ "MEMO2", "M", 10, 0 } }
LOCAL nI, aStruct := { ;
{ "CHARACTER", "C", 25, 0 }, ;
{ "NUMERIC", "N", 8, 0 }, ;
{ "DOUBLE", "N", 8, 2 }, ;
{ "DATE", "D", 8, 0 }, ;
{ "LOGICAL", "L", 1, 0 }, ;
{ "MEMO1", "M", 10, 0 }, ;
{ "MEMO2", "M", 10, 0 } }
REQUEST DBFCDX
@@ -492,9 +493,9 @@
$EXAMPLES$
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
IF testid->( dbSeek( nId ) )
IF testid->( RLock() )
dbDelete()
ENDIF
ENDIF
USE
@@ -535,8 +536,8 @@
SET FILTER TO Id == 1
SELECT Test
//
? DBFILTER()
? testid->( DBFILTER() )
? dbFilter()
? testid->( dbFilter() )
$STATUS$
R
$COMPLIANCE$
@@ -569,10 +570,10 @@
is present, the value of the record pointer will be LASTREC().
$EXAMPLES$
USE tests
DBGOTOP()
? RECNO()
DBGOBOTTOM()
? RECNO()
dbGoTop()
? RecNo()
dbGoBottom()
? RecNo()
USE
$STATUS$
R
@@ -614,14 +615,14 @@
Issuing a DBGOTO(RECNO()) call in a network enviroment will refresh
the database and index buffers. This is the same as a DBSKIP(0) call.
$EXAMPLES$
The following example uses DBGOTO() to iteratively process
The following example uses dbGoto() TO iteratively process
every fourth record:
DBUSEAREA( .T., "DBFNTX", "sales", "sales", .T. )
dbUseArea( .T., "DBFNTX", "sales", "sales", .T. )
//
// toggle every fourth record
DO WHILE ! EOF()
DBGOTO( RECNO() + 4 )
DO WHILE ! Eof()
dbGoto( RecNo() + 4 )
sales->Group := "Bear"
ENDDO
$STATUS$
@@ -656,10 +657,10 @@
is present, the value of RECNO() will be 1.
$EXAMPLES$
USE tests
DBGOTOP()
? RECNO()
DBGOBOTTOM()
? RECNO()
dbGoTop()
? RecNo()
dbGoBottom()
? RecNo()
USE
$STATUS$
R
@@ -695,11 +696,11 @@
with DBRECALL().
$EXAMPLES$
USE test NEW
DBGOTO( 10 )
DBDELETE()
? DELETED()
DBRECALL()
? DELETED()
dbGoto( 10 )
dbDelete()
? Deleted()
dbRecall()
? Deleted()
USE
$STATUS$
R
@@ -740,9 +741,9 @@
PROCEDURE Main()
LOCAL x := 0
USE tests NEW
FOR x := 1 TO reccount()
IF ! DBRLOCK()
DBUNLOCK()
FOR x := 1 TO RecCount()
IF ! dbRLock()
dbUnlock()
ENDIF
NEXT
USE
@@ -782,11 +783,11 @@
LOCAL aList := {}
LOCAL x := 0
USE tests NEW
DBGOTO( 10 )
RLOCK()
DBGOTO( 100 )
RLOCK()
aList := DBRLOCKLIST()
dbGoto( 10 )
RLock()
dbGoto( 100 )
RLock()
aList := dbRLockList()
FOR x := 1 TO Len( aList )
? aList[ x ]
NEXT
@@ -826,10 +827,10 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
DBGOTO( 10 )
IF RLOCK()
dbGoto( 10 )
IF RLock()
? tests->ID
DBRUNLOCK()
dbRUnlock()
ENDIF
USE
RETURN
@@ -890,19 +891,19 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW INDEX tests
DBGOTO( 10 )
dbGoto( 10 )
nId := tests->nId
IF tests->( DBSEEK( nId ) )
IF RLOCK()
IF tests->( dbSeek( nId ) )
IF RLock()
? tests->Name
DBRUNLOCK()
dbRUnlock()
ENDIF
ENDIF
USE
RETURN
ACCEPT "Employee name: " TO cName
IF Employee->( DBSEEK( cName ) )
IF Employee->( dbSeek( cName ) )
Employee->( ViewRecord() )
ELSE
? "Not found"
@@ -948,13 +949,13 @@
LOCAL nId
USE tests NEW INDEX tests
USE tests1 NEW INDEX tests1
DBSELECTAREA( 1 )
dbSelectArea( 1 )
nId := tests->Id
DBSELECTAREA( 2 )
IF DBSEEK( nId )
dbSelectArea( 2 )
IF dbSeek( nId )
? tests1->cName
ENDIF
DBCLOSEALL()
dbCloseAll()
RETURN
$STATUS$
R
@@ -991,7 +992,7 @@
used to activate and manage the work area. If the specified driver is
not avaliable,this function will have no effect.
$EXAMPLES$
DBSETDRIVER("ADS")
dbSetDriver( "ADS" )
$STATUS$
R
$COMPLIANCE$
@@ -1027,10 +1028,10 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
DBGOTOP()
DO WHILE ! EOF()
dbGoTop()
DO WHILE ! Eof()
? tests->Id, tests->Name
DBSKIP()
dbSkip()
ENDDO
USE
RETURN
@@ -1072,8 +1073,8 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
DBSETFILTER( {|| tests->Id <100 }, "tests->Id <100" )
DBGOTOP()
dbSetFilter( {|| tests->Id < 100 }, "tests->Id <100" )
dbGoTop()
$STATUS$
R
$COMPLIANCE$
@@ -1113,7 +1114,7 @@
LOCAL aStru, x
USE tests NEW
aStru := dbStruct()
FOR x := 1 TO LEN( aStru )
FOR x := 1 TO Len( aStru )
? aStru[ x ][ DBS_NAME ]
NEXT
USE
@@ -1150,11 +1151,11 @@
$EXAMPLES$
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
IF testid->( dbSeek( nId ) )
IF testid->( RLock() )
dbDelete()
ELSE
DBUNLOCK()
dbUnlock()
ENDIF
ENDIF
USE
@@ -1188,14 +1189,14 @@
nId := 10
USE tests INDEX testid NEW
USE tests1 INDEX tests NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
IF testid->( dbSeek( nId ) )
IF testid->( RLock() )
dbDelete()
ELSE
DBUNLOCK()
dbUnlock()
ENDIF
ELSE
DBUNLOCKALL()
dbUnlockAll()
ENDIF
USE
$STATUS$
@@ -1259,7 +1260,7 @@
If it is not specified, the file will he opened in normal read-write
mode.
$EXAMPLES$
DBUSEAREA( .T.,, "tests" )
dbUseArea( .T.,, "tests" )
$STATUS$
R
$COMPLIANCE$

View File

@@ -161,10 +161,10 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
DBGOTOP()
? "Is Eof()", EOF()
DBGOBOTTOM()
? "Is Eof()", EOF()
dbGoTop()
? "Is Eof()", Eof()
dbGoBottom()
? "Is Eof()", Eof()
USE
RETURN
$STATUS$
@@ -237,10 +237,10 @@
$EXAMPLES$
PROCEDURE Main()
USE test NEW
DBGOTO()
DBDELETE()
? "Is Record Deleted", Test->( DELETED() )
DBRECALL()
dbGoto()
dbDelete()
? "Is Record Deleted", Test->( Deleted() )
dbRecall()
USE
RETURN
$STATUS$
@@ -278,10 +278,10 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
DBGOTOP()
? "Is Eof()", EOF()
DBGOBOTTOM()
? "Is Eof()", EOF()
dbGoTop()
? "Is Eof()", Eof()
dbGoBottom()
? "Is Eof()", Eof()
USE
RETURN
$STATUS$
@@ -317,7 +317,7 @@
$EXAMPLES$
PROCEDURE Main()
USE tests NEW
? "This database have", tests->( FCOUNT() ), "Fields"
? "This database have", tests->( FCount() ), "Fields"
USE
RETURN
$STATUS$
@@ -396,7 +396,7 @@
PROCEDURE Main()
LOCAL x
USE tests NEW
FOR x := 1 TO tests->( FCOUNT() )
FOR x := 1 TO tests->( FCount() )
? "Field Name", FieldName( x )
NEXT
USE
@@ -437,7 +437,7 @@
$EXAMPLES$
PROCEDURE Main()
USE test NEW
? test->( FIELDPOS( "ID" ) )
? test->( FieldPos( "ID" ) )
USE
RETURN
$STATUS$
@@ -478,7 +478,7 @@
the function will return a NIL data type
$EXAMPLES$
USE tests NEW
FIELDPUT( 1, "Mr. Jones" )
FieldPut( 1, "Mr. Jones" )
USE
$STATUS$
R
@@ -513,8 +513,8 @@
database. This function will also unlock all records locks placed
by the same network station.
$EXAMPLES$
USE tests New
IF FLOCK()
USE tests NEW
IF FLock()
SUM tests->Ammount
ENDIF
USE
@@ -555,7 +555,7 @@
nId := 100
USE tests NEW INDEX tests
SEEK nId
IF FOUND()
IF Found()
? tests->Name
ENDIF
USE
@@ -629,7 +629,7 @@
return a 0 value as well.
$EXAMPLES$
USE tests NEW
? LASTREC(), RECCOUNT()
? LastRec(), RecCount()
$TESTS$
$STATUS$
@@ -719,10 +719,10 @@
$EXAMPLES$
USE test NEW INDEX test
IF ! NetErr()
SEEK test->Name := "HARBOUR"
IF Found()
? test->Name
ENDIF
SEEK test->Name := "HARBOUR"
IF Found()
? test->Name
ENDIF
ENDIF
USE
$STATUS$
@@ -803,10 +803,10 @@
file, the value of this function will be 1.
$EXAMPLES$
USE tests NEW
DBGOTOP()
RECNO() // Returns 1
DBGOTO( 50 )
RECNO() // Returns 50
dbGoTop()
RecNo() // Returns 1
dbGoto( 50 )
RecNo() // Returns 50
$TESTS$
$STATUS$
@@ -844,10 +844,10 @@
will be 0.
$EXAMPLES$
USE tests NEW
DBGOTOP()
RECSIZE() // Returns 1
DBGOTO( 50 )
RECSIZE()
dbGoTop()
RecSize() // Returns 1
dbGoto( 50 )
RecSize()
$TESTS$
$STATUS$
@@ -899,9 +899,9 @@
$EXAMPLES$
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
IF testid->( dbSeek( nId ) )
IF testid->( RLock() )
dbDelete()
ENDIF
ENDIF
USE
@@ -984,12 +984,12 @@
$EXAMPLES$
USE tests NEW
USE names NEW
? USED() // .T.
? TESTS->( USED() ) //.T.
? Used() // .T.
? TESTS->( Used() ) //.T.
CLOSE
? USED() // .F.
? Used() // .F.
SELECT tests
? USED() //.T.
? Used() //.T.
$TESTS$
$STATUS$
@@ -1028,7 +1028,7 @@
on the first record in the database.
$EXAMPLES$
USE tests NEW INDEX tests
DBGOTO( 10 )
dbGoto( 10 )
DELETE NEXT 10
PACK
USE

View File

@@ -40,11 +40,11 @@
This function replaces the Indexord() function.
$EXAMPLES$
USE tests NEW VIA "DBFNTX"
? ORDBAGEXT() // Returns .ntx
DBCLOSEAREA()
? ordBagExt() // Returns .ntx
dbCloseArea()
USE tests NEW VIA "DBFCDX"
? ORDBAGEXT() // Returns .cdx
DBCLOSEAREA()
? ordBagExt() // Returns .cdx
dbCloseArea()
$STATUS$
S
$COMPLIANCE$
@@ -88,9 +88,9 @@
$EXAMPLES$
USE tests VIA "DBFCDX" NEW
SET INDEX TO tests
ORDBAGNAME( "TeName" ) // Returns: Customer
ORDBAGNAME( "TeLast" ) // Returns: Customer
ORDBAGNAME( "teZip" ) // Returns: Customer
ordBagName( "TeName" ) // Returns: Customer
ordBagName( "TeLast" ) // Returns: Customer
ordBagName( "teZip" ) // Returns: Customer
SET ORDER TO TAG TeName
? OrderBagName() // Returns: Custumer
$TESTS$
@@ -215,10 +215,10 @@
name in the order list in the current or specified work area.
$EXAMPLES$
USE tests VIA "DBFNDX" NEW
ORDCREATE( "FNAME",, "Tests->fName" )
ordCreate( "FNAME",, "Tests->fName" )
USE tests VIA "DBFCDX" NEW
ORDCREATE( , "lName", "tests->lName" )
ordCreate( , "lName", "tests->lName" )
$TESTS$
See examples
$STATUS$
@@ -266,7 +266,7 @@
and RDDADS drivers).
$EXAMPLES$
USE tests VIA "DBFCDX" NEW
OrdDestroy( "lName", "tests" )
ordDestroy( "lName", "tests" )
$TESTS$
See examples
$STATUS$
@@ -316,7 +316,7 @@
TO tests ;
FOR tests->ID > 100
ORDFOR( "tests" ) // Returns: tests->ID > 100
ordFor( "tests" ) // Returns: tests->ID > 100
$TESTS$
See examples
$STATUS$
@@ -363,10 +363,9 @@
FOR tests->fName > "CK"
INDEX ON tests->Id TO TestId
ORDKEY( "tests" ) // Returns: tests->fName
ordKey( "tests" ) // Returns: tests->fName
SET ORDER TO 2
ORDKEY() // Returns: tests->Id
ordKey() // Returns: tests->Id
$STATUS$
S
$COMPLIANCE$
@@ -405,7 +404,7 @@
".ntx". This is controled by the particular database driver that is
linked with the application.
$EXAMPLES$
IF INDEXEXT() == ".ntx"
IF IndexExt() == ".ntx"
? "Current driver being used is DBFNTX"
ENDIF
$STATUS$
@@ -449,7 +448,7 @@
byte will be returned.
$EXAMPLES$
USE tests NEW INDEX test1
? INDEXKEY( 1 )
? IndexKey( 1 )
$STATUS$
R
$COMPLIANCE$
@@ -487,8 +486,8 @@
the database,which therefore is in the natural order.
$EXAMPLES$
USE tests NEW INDEX test1
IF INDEXORD() > 0
? "Current order is", INDEXORD()
IF IndexOrd() > 0
? "Current order is", IndexOrd()
ENDIF
$STATUS$
R

View File

@@ -133,11 +133,11 @@
LOCAL cVar := Space( 50 )
LOCAL nId := 0
CLS
@ 3,1 SAY "Name" GET cVar PICTURE "@!S 30"
@ 4,1 SAY "Id" GET nId PICTURE "999.999"
@ 3, 1 SAY "Name" GET cVar PICTURE "@!S 30"
@ 4, 1 SAY "Id" GET nId PICTURE "999.999"
READ
? "The name you entered is",cVar
? "The id you entered is",nId
? "The name you entered is", cVar
? "The id you entered is", nId
RETURN
$TESTS$
See Examples

View File

@@ -636,7 +636,7 @@
return-parameter
$EXAMPLES$
LOCAL bOldF10, bOldF10Cond
bOldF10 := HB_SetKeyGet( K_F10, @bOldF10Cond )
bOldF10 := hb_SetKeyGet( K_F10, @bOldF10Cond )
... // some other processing
SetKey( K_F10, bOldF10, bOldF10Cond )
$TESTS$
@@ -678,9 +678,9 @@
returned from a previous call to SetKeySave() - to restore that list,
or the value of NIL to clear the current list.
$EXAMPLES$
LOCAL aKeys := HB_SetKeySave( NIL ) // removes all current set=keys
LOCAL aKeys := hb_SetKeySave( NIL ) // removes all current set=keys
... // some other processing
HB_SetKeySave( aKeys )
hb_SetKeySave( aKeys )
$TESTS$
None definable
$STATUS$
@@ -726,11 +726,11 @@
ACCEPT, INPUT, READ, and WAIT
$EXAMPLES$
// within ReadModal()
IF HB_SetKeyCheck( K_ALT_X, GetActive() )
IF hb_SetKeyCheck( K_ALT_X, GetActive() )
... // some other processing
ENDIF
// within TBrowse handler
CASE HB_SetKeyCheck( nInkey, oTBrowse )
CASE hb_SetKeyCheck( nInkey, oTBrowse )
RETURN
CASE nInKey == K_ESC
... // some other processing
@@ -775,17 +775,17 @@
A group of keys may be assigned the same code block/condition block
by using an array of key values in place on the first parameter.
$EXAMPLES$
LOCAL bOldF10 := setKey( K_F10, {|| Yahoo() } )
LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } )
... // some other processing
SET KEY K_F10 TO bOldF10
... // some other processing
bBlock := SetKey( K_SPACE )
IF bBlock != NIL ...
// make F10 exit current get, but only if in a get - ignores other
// wait-states such as menus, achoices, etc...
SetKey( K_F10, {|| GetActive():State := GE_WRITE },;
{|| GetActive() != NIL } )
// make F10 exit current get, but only if in a get - ignores other
// wait-states such as menus, achoices, etc...
SetKey( K_F10, {|| GetActive():State := GE_WRITE }, ;
{|| GetActive() != NIL } )
$TESTS$
None definable
$STATUS$
@@ -1442,7 +1442,7 @@
$EXAMPLES$
SET BELL ON
cDummy := Space( 20 )
@ 3,2 GET cDummy
@ 3, 2 GET cDummy
READ
SET BELL OFF
$STATUS$

View File

@@ -58,14 +58,14 @@
returned by MAXROW() and MAXCOL().
$EXAMPLES$
// The first example change to a 12 lines of display mode:
IF SetMode( 12, 40)
IF SetMode( 12, 40 )
? "Hey man are you blind ?"
ELSE
? "Mom bring me my glasses!"
ENDIF
// Next example change to a 50 lines mode:
IF SETMODE( 50, 80)
IF SetMode( 50, 80 )
? "This wonderful mode was successfully set"
ELSE
? "Wait. this monitor are not made in rubber !"

View File

@@ -42,8 +42,8 @@
in <cString> is an alphabetic character. If not, the function will
return a logical false (.F.).
$EXAMPLES$
? 'isalpha( "hello" ) = ', isalpha( "hello" )
? 'isalpha( "12345" ) = ', isalpha( "12345" )
? 'isalpha( "hello" ) = ', IsAlpha( "hello" )
? 'isalpha( "12345" ) = ', IsAlpha( "12345" )
$STATUS$
R
$COMPLIANCE$
@@ -80,8 +80,8 @@
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
$EXAMPLES$
? ISDIGIT( "12345" ) // .T.
? ISDIGIT( "abcde" ) // .F.
? IsDigit( "12345" ) // .T.
? IsDigit( "abcde" ) // .F.
$STATUS$
R
$COMPLIANCE$
@@ -118,8 +118,8 @@
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
$EXAMPLES$
? ISUPPER( "Abcde" ) // .T.
? ISUPPER( "abcde" ) // .F.
? IsUpper( "Abcde" ) // .T.
? IsUpper( "abcde" ) // .F.
$STATUS$
R
$COMPLIANCE$
@@ -156,8 +156,8 @@
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
$EXAMPLES$
? islower( "ABCde" ) // .F.
? islower( "aBCde" ) // .T.
? IsLower( "ABCde" ) // .F.
? IsLower( "aBCde" ) // .T.
$STATUS$
R
$COMPLIANCE$
@@ -192,7 +192,7 @@
$DESCRIPTION$
This function trims the leading space blank
$EXAMPLES$
? LTRIM( "HELLO " )
? LTrim( "HELLO " )
$STATUS$
R
$COMPLIANCE$
@@ -319,7 +319,7 @@
SUBSTR( <cString>, 1, <nLen> )
$EXAMPLES$
? LEFT( "HELLO HARBOUR", 5 ) // HELLO
? Left( "HELLO HARBOUR", 5 ) // HELLO
$STATUS$
R
$COMPLIANCE$
@@ -360,7 +360,7 @@
SUBSTR( <cString>, LEN( <cString> ) - <nLen> + 1, <nLen> )
$EXAMPLES$
? RIGHT( "HELLO HARBOUR", 5 ) // RBOUR
? Right( "HELLO HARBOUR", 5 ) // RBOUR
$STATUS$
R
$COMPLIANCE$
@@ -407,9 +407,9 @@
characters from <nStart> to the end of the string is less than <nLen>
the rest are ignored.
$EXAMPLES$
? SUBSTR( "HELLO HARBOUR" , 7, 4 ) // HARB
? SUBSTR( "HELLO HARBOUR" , -3, 3 ) // OUR
? SUBSTR( "HELLO HARBOUR" , 7 ) // HARBOUR
? SubStr( "HELLO HARBOUR" , 7, 4 ) // HARB
? SubStr( "HELLO HARBOUR" , -3, 3 ) // OUR
? SubStr( "HELLO HARBOUR" , 7 ) // HARBOUR
$STATUS$
R
$COMPLIANCE$
@@ -564,8 +564,8 @@
The STRZERO() function was part of the CA-Cl*pper samples.
$EXAMPLES$
? STRZERO( 10, 6, 2 ) // "010.00"
? STRZERO( -10, 8, 2 ) // "-0010.00"
? StrZero( 10, 6, 2 ) // "010.00"
? StrZero( -10, 8, 2 ) // "-0010.00"
$TESTS$
see the regression test suit for comprehensive tests.
$STATUS$
@@ -600,16 +600,16 @@
$DESCRIPTION$
HB_VALTOSTR can be used to convert any scalar value to a string.
$EXAMPLES$
? HB_VALTOSTR( 4 )
? HB_VALTOSTR( "String" )
? hb_ValToStr( 4 )
? hb_ValToStr( "String" )
$TESTS$
? HB_VALTOSTR( 4 ) == " 4"
? HB_VALTOSTR( 4.0 / 2 ) == " 2.00"
? HB_VALTOSTR( "String" ) == "String"
? HB_VALTOSTR( STOD( "20010101" ) ) == "01/01/01"
? HB_VALTOSTR( NIL ) == "NIL"
? HB_VALTOSTR( .F. ) == ".F."
? HB_VALTOSTR( .T. ) == ".T."
? hb_ValToStr( 4 ) == " 4"
? hb_ValToStr( 4.0 / 2 ) == " 2.00"
? hb_ValToStr( "String" ) == "String"
? hb_ValToStr( SToD( "20010101" ) ) == "01/01/01"
? hb_ValToStr( NIL ) == "NIL"
? hb_ValToStr( .F. ) == ".F."
? hb_ValToStr( .T. ) == ".T."
$STATUS$
R
$COMPLIANCE$
@@ -644,13 +644,13 @@
size of a hash table. If it is used with a multidimensional array it
returns the size of the first dimension.
$EXAMPLES$
? LEN( "Harbour" ) // 7
? LEN( { "One", "Two" } ) // 2
? Len( "Harbour" ) // 7
? Len( { "One", "Two" } ) // 2
$TESTS$
PROCEDURE Main()
LOCAL cName := ""
ACCEPT "Enter your name: " TO cName
? LEN( cName )
? Len( cName )
RETURN
$STATUS$
R
@@ -685,17 +685,17 @@
This function checks if an expression has empty value and returns a
logical indicating whether it the expression is empty or not.
$EXAMPLES$
? EMPTY( "I'm not empty" ) // .F.
? Empty( "I'm not empty" ) // .F.
$TESTS$
PROCEDURE Main()
? EMPTY( NIL ) // .T.
? EMPTY( 0 ) // .T.
? EMPTY( .F. ) // .T.
? EMPTY( "" ) // .T.
? EMPTY( 1 ) // .F.
? EMPTY( .T. ) // .F.
? EMPTY( "smile" ) // .F.
? EMPTY( Date() ) // .F.
? Empty( NIL ) // .T.
? Empty( 0 ) // .T.
? Empty( .F. ) // .T.
? Empty( "" ) // .T.
? Empty( 1 ) // .F.
? Empty( .T. ) // .F.
? Empty( "smile" ) // .F.
? Empty( Date() ) // .F.
RETURN
$STATUS$
R
@@ -730,9 +730,9 @@
useful to build descending indexes.
$EXAMPLES$
// Seek for Smith in a descending index
SEEK DESCEND( "SMITH" )
SEEK Descend( "SMITH" )
$TESTS$
DATA->( DBSEEK( DESCEND( "SMITH" ) ) )
DATA->( dbSeek( Descend( "SMITH" ) ) )
will seek "SMITH" into a descending index.
$STATUS$
R
@@ -767,8 +767,8 @@
to its lowercased representation. Any non alphabetic character withing
<cString> will remain unchanged.
$EXAMPLES$
? LOWER( "HARBOUR" ) // harbour
? LOWER( "Hello All" ) // hello all
? Lower( "HARBOUR" ) // harbour
? Lower( "Hello All" ) // hello all
$STATUS$
R
$COMPLIANCE$
@@ -803,8 +803,8 @@
This function converts all alpha characters in <cString> to upper
case values and returns that formatted character expression.
$EXAMPLES$
? UPPER( "harbour" ) // HARBOUR
? UPPER( "Harbour" ) // HARBOUR
? Upper( "harbour" ) // HARBOUR
? Upper( "Harbour" ) // HARBOUR
$STATUS$
R
$COMPLIANCE$
@@ -844,8 +844,8 @@
The CHR() function may be used for printing special codes as well
as normal and graphics character codes.
$EXAMPLES$
? CHR( 32 )
? chr( 215 )
? Chr( 32 )
? Chr( 215 )
$STATUS$
R
$COMPLIANCE$
@@ -880,8 +880,8 @@
This function return the ASCII value of the leftmost character of
any character expression passed as <cCharacter>.
$EXAMPLES$
? ASC( "A" )
? ASC( "¹" )
? Asc( "A" )
? Asc( "¹" )
$STATUS$
R
$COMPLIANCE$
@@ -927,9 +927,9 @@
truncate the string <xVal> from the leftmost side to the length of
<nWidth>.
$EXAMPLES$
? PADC( "Harbour", 20 )
? PADC( 34.5142, 20 )
? PADC( Date(), 35 )
? PadC( "Harbour", 20 )
? PadC( 34.5142, 20 )
? PadC( Date(), 35 )
$TESTS$
See Examples
$STATUS$
@@ -977,9 +977,9 @@
truncate the string <xVal> from the leftmost side to the length of
<nWidth>.
$EXAMPLES$
? PADL( "Harbour", 20 )
? PADL( 34.5142, 20 )
? PADL( Date(), 35 )
? PadL( "Harbour", 20 )
? PadL( 34.5142, 20 )
? PadL( Date(), 35 )
$TESTS$
See examples
$STATUS$
@@ -1027,9 +1027,9 @@
truncate the string <xVal> from the leftmost side to the length of
<nWidth>.
$EXAMPLES$
? PADR( "Harbour", 20 )
? PADR( 34.5142, 20 )
? PADR( Date(), 35 )
? PadR( "Harbour", 20 )
? PadR( 34.5142, 20 )
? PadR( Date(), 35 )
$TESTS$
See examples
$STATUS$
@@ -1066,10 +1066,10 @@
This function returns the string <cExpression> will all leading and
trailing blank spaces removed.
$EXAMPLES$
? ALLTRIM( "HELLO HARBOUR" )
? ALLTRIM( " HELLO HARBOUR" )
? ALLTRIM( "HELLO HARBOUR " )
? ALLTRIM( " HELLO HARBOUR " )
? AllTrim( "HELLO HARBOUR" )
? AllTrim( " HELLO HARBOUR" )
? AllTrim( "HELLO HARBOUR " )
? AllTrim( " HELLO HARBOUR " )
$TESTS$
See Examples
$STATUS$
@@ -1110,10 +1110,10 @@
Together with LTRIM(), this function equated to the ALLTRIM()
function.
$EXAMPLES$
? RTRIM( "HELLO" ) // "HELLO"
? RTRIM( "" ) // ""
? RTRIM( "UA " ) // "UA"
? RTRIM( " UA" ) // " UA"
? RTrim( "HELLO" ) // "HELLO"
? RTrim( "" ) // ""
? RTrim( "UA " ) // "UA"
? RTrim( " UA" ) // " UA"
$TESTS$
See Examples
$STATUS$
@@ -1154,10 +1154,10 @@
Together with LTRIM(), this function equated to the ALLTRIM()
function.
$EXAMPLES$
? TRIM( "HELLO" ) // "HELLO"
? TRIM( "" ) // ""
? TRIM( "UA " ) // "UA"
? TRIM( " UA" ) // " UA"
? Trim( "HELLO" ) // "HELLO"
? Trim( "" ) // ""
? Trim( "UA " ) // "UA"
? Trim( " UA" ) // " UA"
$TESTS$
See Examples
$STATUS$
@@ -1200,8 +1200,8 @@
A value of 0 for <nSize> will return a NULL string.
$EXAMPLES$
? REPLICATE( "a", 10 ) // aaaaaaaaaa
? REPLICATE( "b", 100000 )
? Replicate( "a", 10 ) // aaaaaaaaaa
? Replicate( "b", 100000 )
$TESTS$
See Examples
$STATUS$
@@ -1247,7 +1247,7 @@
LOCAL cString := Space( 20 ) // Create an character memory variable
// with length 20
? Len( cString ) // 20
cBigString := space( 100000 ) // create a memory variable with 100000
cBigString := Space( 100000 ) // create a memory variable with 100000
// blank spaces
? Len( cBigString )
USE tests NEW
@@ -1261,9 +1261,9 @@
IF ! Empty( Alias() )
nRecord := RecNo()
dbgoto( 0 )
dbGoto( 0 )
IF ValType( xField ) == "C"
xField := AScan( dbstruct(), {| aFields | aFields[ 1 ] == Upper( xfield ) } )
xField := AScan( dbStruct(), {| aFields | aFields[ 1 ] == Upper( xfield ) } )
ELSE
DEFAULT xField TO 0
IF xField < 1 .OR. xField > FCount()
@@ -1273,7 +1273,7 @@
IF !( xfield == 0 )
xRetvalue := FieldGet( xfield )
ENDIF
dbgoto( nrecord )
dbGoto( nrecord )
ENDIF
RETURN xRetvalue
$TESTS$
@@ -1314,7 +1314,7 @@
This functions is the oppose of the STR() function.
$EXAMPLES$
? VAL( "31421" ) // 31421
? Val( "31421" ) // 31421
$TESTS$
See regression test
$STATUS$
@@ -1367,9 +1367,9 @@
in <cString> are to the replaced. The default of <nOccurrences> is
all occurrences.
$EXAMPLES$
? STRTRAN( "Harbour Power", " ", " " ) // Harbour Power
// Harbour Power The future of xBase
? STRTRAN( "Harbour Power The Future of xBase", " ", " " ,, 2 )
? StrTran( "Harbour Power", " ", " " ) // Harbour Power
// Harbour Power The future of xBase
? StrTran( "Harbour Power The Future of xBase", " ", " " , , 2 )
$TESTS$
See regression test
$STATUS$

View File

@@ -49,7 +49,7 @@
FUNCTION TestObject()
LOCAL oObject
oObject := HBClass():New("TMyClass")
oObject := HBClass():New( "TMyClass" )
oObject:End()
RETURN NIL

View File

@@ -265,7 +265,7 @@
aOptions := { "Ok", "www.jobs.com", "Oops" }
// show message and let end user select panic level
nChoice := ALERT( cMessage, aOptions )
nChoice := Alert( cMessage, aOptions )
DO CASE
CASE nChoice == 0
// do nothing, blame it on some one else
@@ -461,7 +461,7 @@
using the default transformation for the type of expression.
$EXAMPLES$
// Output a negative dollar amount using debit notation.
DEVOUTPICT( -1.25, "@D$ 99,999.99 )
DevOutPict( -1.25, "@D$ 99,999.99 )
$TESTS$
@ 3, 1 SAY -1.25 PICTURE "@D$ 99,999.99"
will display "$( 1.25)" starting on row four, column two of the
@@ -644,10 +644,10 @@
redirected according with the screen driver, and OUTSTD() send its
output to the standard output device (STDOUT) and can be redirected.
$EXAMPLES$
OUTSTD( "Hello" ) // Result: Hello
OutStd( "Hello" ) // Result: Hello
OUTSTD( 1, .T., NIL, "A" )
OUTSTD( "B" ) // Result: 1 .T. NIL AB
OutStd( 1, .T., NIL, "A" )
OutStd( "B" ) // Result: 1 .T. NIL AB
$TESTS$
$STATUS$
@@ -698,7 +698,7 @@
the HB_CLP_UNDOC flag.
$EXAMPLES$
// write error log information
OUTERR( DATE(), TIME(), "Core meltdown detected" )
OutErr( Date(), Time(), "Core meltdown detected" )
$TESTS$
$STATUS$
@@ -741,19 +741,19 @@
On compile time this command is translated into __EJECT() function.
$EXAMPLES$
Use Clientes New
Set Device to Printer
CurPos:=0
While !Eof()
? Clientes->nome,Clientes->endereco
Curpos++
if Curpos >59
Curpos:=0
Eject
Endif
Enddo
Set Device to Screen
Use
USE Clientes NEW
SET DEVICE TO PRINTER
CurPos := 0
WHILE !Eof()
? Clientes->nome, Clientes->endereco
Curpos++
IF Curpos > 59
Curpos := 0
EJECT
ENDIF
ENDDO
SET DEVICE TO SCREEN
USE
$TESTS$
See examples
$STATUS$
@@ -859,7 +859,7 @@
This function returns the current cursor column position. The value
for this function can range between 0 and MAXCOL().
$EXAMPLES$
? MAXCol()
? MaxCol()
$STATUS$
R
$COMPLIANCE$
@@ -895,7 +895,7 @@
This function returns the current cursor row location. The value
for this function can range between 0 and MAXCOL().
$EXAMPLES$
? MAXROW()
? MaxRow()
$STATUS$
R
$COMPLIANCE$

View File

@@ -137,7 +137,7 @@
PROCEDURE Main()
PRIVATE mPrivate
mPrivate :="PRIVATE from MAIN()"
mPrivate := "PRIVATE from MAIN()"
? mPrivate //PRIVATE from MAIN()
Test()
? mPrivate //PRIVATE from MAIN()
@@ -398,14 +398,14 @@
nCnt := __mvDBGINFO( HB_MV_PRIVATE ) + 1
FOR i := 1 TO nCnt
xVal := __mvDBGINFO( HB_MV_PRIVATE, i, @cName )
? i, "=", cName, xVal
xVal := __mvDBGINFO( HB_MV_PRIVATE, i, @cName )
? i, "=", cName, xVal
NEXT
nCnt := __mvDBGINFO( HB_MV_PUBLIC ) + 1
FOR i := 1 TO nCnt
xVal := __mvDBGINFO( HB_MV_PUBLIC, i, @cName )
? i, "=", cName, xVal
xVal := __mvDBGINFO( HB_MV_PUBLIC, i, @cName )
? i, "=", cName, xVal
NEXT
RETURN
@@ -443,11 +443,11 @@
STATIC TheStatic
PUBLIC ThePublic
PRIVATE ThePrivate
? __MVEXIST( "NotExist" ) // .F.
? __MVEXIST( "TheLocal" ) // .F.
? __MVEXIST( "TheStatic" ) // .F.
? __MVEXIST( "ThePublic" ) // .T.
? __MVEXIST( "ThePrivate" ) // .T.
? __mvExist( "NotExist" ) // .F.
? __mvExist( "TheLocal" ) // .F.
? __mvExist( "TheStatic" ) // .F.
? __mvExist( "ThePublic" ) // .T.
? __mvExist( "ThePrivate" ) // .T.
$STATUS$
R
$COMPLIANCE$
@@ -481,11 +481,11 @@
this variable exists otherwise it generates a runtime error.
The variable is specified by its name passed as the function parameter.
$EXAMPLES$
FUNCTION MEMVARBLOCK( cMemvar )
FUNCTION MemVarBlock( cMemvar )
RETURN {| x | ;
iif( PCOUNT() == 0, ;
__MVGET( cMemvar ),;
__MVPUT( cMemvar, x ) ) }
iif( PCount() == 0, ;
__mvGet( cMemvar ), ;
__mvPut( cMemvar, x ) ) }
$STATUS$
R
$COMPLIANCE$
@@ -523,11 +523,11 @@
parameter.
If a value is not specified then the NIL is assumed
$EXAMPLES$
FUNCTION MEMVARBLOCK( cMemvar )
FUNCTION MemVarBlock( cMemvar )
RETURN {| x | ;
iif( PCOUNT() == 0, ;
__MVGET( cMemvar ),;
__MVPUT( cMemvar, x ) ) }
iif( PCount() == 0, ;
__mvGet( cMemvar ), ;
__mvPut( cMemvar, x ) ) }
$STATUS$
R
$COMPLIANCE$
@@ -569,9 +569,9 @@
LOCAL cbSetGet
PUBLIC xPublic
cbSetGet := MEMVARBLOCK( "xPublic" )
EVAL( cbSetGet, "new value" )
? "Value of xPublic variable", EVAL( cbSetGet )
cbSetGet := MemVarBlock( "xPublic" )
Eval( cbSetGet, "new value" )
? "Value of xPublic variable", Eval( cbSetGet )
RETURN
$STATUS$
@@ -619,11 +619,11 @@
$EXAMPLES$
// open a file named Test that have a field named "name"
LOCAL bField
bFiled := FIELDBLOCK( "name" )
bFiled := FieldBlock( "name" )
USE Test
? "Original value of field 'name' :", EVAL( bField )
EVAL( bField, "Mr X new name" )
? "New value for the field 'name' :", EVAL( bField )
? "Original value of field 'name' :", Eval( bField )
Eval( bField, "Mr X new name" )
? "New value for the field 'name' :", Eval( bField )
$STATUS$
R
$COMPLIANCE$
@@ -673,7 +673,7 @@
$EXAMPLES$
LOCAL bField
// this block work on the field "name" that exist on work area 2
bFiled := FIELDBLOCK( "name", 2 )
bFiled := FieldBlock( "name", 2 )
// open a file named One in work area 1
// that have a field named "name"
SELECT 1
@@ -684,8 +684,8 @@
USE two
SELECT 1
? "Original names: ", One->name, Two->name
? "Name value for file Two :", EVAL( bField )
EVAL( bField, "Two has new name" )
? "Name value for file Two :", Eval( bField )
Eval( bField, "Two has new name" )
? "and now: ", One->name, Two->name
$STATUS$
R
@@ -757,22 +757,22 @@
argument with a valid Harbour expression - the data type of this
expression is returned.
$EXAMPLES$
? TYPE( "{ 1, 2 }" ) // prints "A"
? TYPE( "iif( .T., SubStr( "TYPE", 2, 1 ), .F. )" ) // prints "C"
? TYPE( "At( "OK", MyUDF() ) > 0" ) // prints "UI"
? TYPE( "{ 1, 2 }[ 5 ]" ) // prints "UE"
? Type( "{ 1, 2 }" ) // prints "A"
? Type( "iif( .T., SubStr( "TYPE", 2, 1 ), .F. )" ) // prints "C"
? Type( "At( "OK", MyUDF() ) > 0" ) // prints "UI"
? Type( "{ 1, 2 }[ 5 ]" ) // prints "UE"
//--------------------------------------------------------
LOCAL c
PRIVATE a := "A", b := "B"
? TYPE( "a + b + c" ) // prints: "U" ('C' variable is a local one)
? Type( "a + b + c" ) // prints: "U" ('C' variable is a local one)
//--------------------------------------------------------
LOCAL cFilter := Space( 60 )
ACCEPT "Enter filter expression:" TO cFilter
IF TYPE( cFilter ) $ "CDLMN"
IF Type( cFilter ) $ "CDLMN"
// this is a valid expression
SET FILTER TO &cFilter
ENDIF
@@ -848,7 +848,7 @@
? ValType( .T. ) // "L"
? ValType( 1 ) // "N"
? ValType( TBrowse() ) // "O"
? ValType( hb_idleadd() ) // "P" Harbour extension
? ValType( hb_idleAdd() ) // "P" Harbour extension
? ValType( @QOut() ) // "S" Harbour extension
? ValType( NIL ) // "U"
RETURN

View File

@@ -1329,7 +1329,9 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
LOCAL lHBMAINDLLP
LOCAL cStdOut, cStdErr
#ifdef _HBMK_LIB_HINTS_
LOCAL cStdErr
#endif
IF s_cSecToken == NIL
s_cSecToken := StrZero( hb_rand32(), 10, 0 )
@@ -6597,7 +6599,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ENDIF
ENDIF
IF ! hbmk[ _HBMK_lDONTEXEC ] .AND. ( tmp := hb_processRun( cCommand,, @cStdOut, @cStdErr ) ) != 0
IF ! hbmk[ _HBMK_lDONTEXEC ] .AND. ( tmp := hb_processRun( cCommand /* ,,, @cStdErr */ ) ) != 0
_hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Running linker. %1$d" ), tmp ) )
IF ! hbmk[ _HBMK_lQuiet ]
OutErr( cCommand + _OUT_EOL )
@@ -6605,7 +6607,9 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
IF ! hbmk[ _HBMK_lIGNOREERROR ]
hbmk[ _HBMK_nErrorLevel ] := _ERRLEV_RUNLINKER
ENDIF
AdviseMissingLibs( hbmk, cStdErr + hb_eol() + cStdOut )
#ifdef _HBMK_LIB_HINTS_
AdviseMissingLibs( hbmk, cStdErr )
#endif
ENDIF
IF ! Empty( cScriptFile )
@@ -6711,7 +6715,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ENDIF
ENDIF
IF ! hbmk[ _HBMK_lDONTEXEC ] .AND. ( tmp := hb_processRun( cCommand,, @cStdOut, @cStdErr ) ) != 0
IF ! hbmk[ _HBMK_lDONTEXEC ] .AND. ( tmp := hb_processRun( cCommand /* ,,, @cStdErr */ ) ) != 0
_hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Running dynamic lib link command. %1$d" ), tmp ) )
IF ! hbmk[ _HBMK_lQuiet ]
OutErr( cCommand + _OUT_EOL )
@@ -6719,7 +6723,9 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
IF ! hbmk[ _HBMK_lIGNOREERROR ]
hbmk[ _HBMK_nErrorLevel ] := _ERRLEV_RUNLINKER
ENDIF
AdviseMissingLibs( hbmk, cStdErr + hb_eol() + cStdOut )
#ifdef _HBMK_LIB_HINTS_
AdviseMissingLibs( hbmk, cStdErr )
#endif
ENDIF
IF ! Empty( cScriptFile )
@@ -12212,6 +12218,8 @@ STATIC FUNCTION MacOSXFiles( hbmk, nType, cPROGNAME )
RETURN cString
#ifdef _HBMK_LIB_HINTS_
STATIC PROCEDURE AdviseMissingLibs( hbmk, cOutput )
LOCAL hAll := GetListOfFunctionsKnown( hbmk )
@@ -12339,20 +12347,30 @@ STATIC FUNCTION GetListOfFunctionsKnownLoadHBX( cFileName, cRoot, hAll )
LOCAL pRegex
LOCAL tmp
LOCAL aDynamic := {}
LOCAL cFilter
IF ! Empty( cFile := hb_MemoRead( cFileName ) ) .AND. ;
! Empty( pRegex := hb_regexComp( "^DYNAMIC ([a-zA-Z0-9_]*)$", .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
IF tmp[ 2 ] $ hAll
hAll[ tmp[ 2 ] ] += "," + cName
ELSE
hAll[ tmp[ 2 ] ] := cName
IF ! Empty( cFile := hb_MemoRead( cFileName ) )
FOR EACH cFilter IN { ;
"^DYNAMIC ([a-zA-Z0-9_]*)$", ;
"ANNOUNCE ([a-zA-Z0-9_]*)$" }
IF ! Empty( pRegex := hb_regexComp( cFilter, .T., .T. ) )
FOR EACH tmp IN hb_regexAll( pRegex, StrTran( cFile, Chr( 13 ) ),,,,, .T. )
IF tmp[ 2 ] $ hAll
hAll[ tmp[ 2 ] ] += "," + cName
ELSE
hAll[ tmp[ 2 ] ] := cName
ENDIF
NEXT
ENDIF
NEXT
ENDIF
RETURN aDynamic
#endif
STATIC FUNCTION mk_extern( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX, cLibHBX_Regex, cOutputName )
LOCAL aExtern