* harbour/contrib/hbwin/olecore.c
! fixed old bug in passing parameters by reference to OLE objects
(they were cleared in reverted order so half of the complex variants
were cleared before coping to HVM items)
+ harbour/contrib/hbwin/tests/oletst4.prg
+ harbour/contrib/hbwin/tests/olesrv4.hbp
+ harbour/contrib/hbwin/tests/olesrv4.prg
+ harbour/contrib/hbwin/tests/oletst4.hbp
+ added example of OLE server returning to client HVM objects as
OLE object and also some other values using parameters passed by
reference with client code.
Remember about registering the server by 'regsvr32 olesrv2.dll'
before testing the client code.
* src/common/hbver.c
+ Fine tuned SunPro version detection.
Patch submitted by Tamas Tevesz.
* contrib/hbwin/win_shell.c
* contrib/hbwin/tests/testcopy.prg
! WIN_SHFILEOPERATION() fixed after initial upload.
+ Added more test code.
* contrib/hbmisc/calldll.prg
+ HB_DYNCALL1() will now cut the number of parameters
according to passed nCount parameter, just to mimic
exact behavior of original function.
+ contrib/hbmisc/tests/testcall.prg
+ Added test code for CALLDLL32() and HB_DYNCALL1().
* contrib/hbwin/tests/testcopy.prg
* Copyright year.
* contrib/hbwin/wapi_wingdi.c
* contrib/hbwin/hbolesrv.c
! Fixed for msvcarm.
* contrib/hbwin/hbwin.ch
* contrib/hbwin/win_shell.c
+ contrib/hbwin/tests/testcopy.prg
+ Added:
WIN_SHFileOperation( [<hWnd>], [<nFunction>], [<cFrom>|<aFrom>], [<cTo>|<aTo>],
[<nFlags>], [<@lAnyOperationAborted>],
[<aNameMappings>], [<cProgressTitle>] ) -> <nResult>
; Przemek, if you have some time pls review s_StringList()
function which I adapted from similar function in win_dlg.c,
but it might not be perfect. '<s1><\0><s2><\0><\0>' format
is required by this SHFileOperation() Windows function.
* include/hbapi.h
! Added HB_EXPORT to hb_memvarGet() and hb_memvarSetValue()
used by new OLE server code in hbwin when created -shared
OLE server .dlls.
+ contrib/hbwin/hbolesrv.hbc
+ Added .hbc file to help creating OLE servers.
* contrib/hbwin/tests/olesrv1.hbp
* contrib/hbwin/tests/olesrv2.hbp
* contrib/hbwin/tests/olesrv3.hbp
% Changed to use hbolesrv.hbc.
- Deleted '-static' option to also allow to build -shared
OLE servers. (I tested them OK)
* contrib/hbwin/tests/olesrv2.prg
+ Tweak to allow case-insensitive access of OLE functions.
* utils/hbmk2/hbmk2.prg
+ Added support for .def files in source= .hbc line.
* contrib/hbwin/tests/oletst1.hbp
* contrib/hbwin/tests/olesrv1.hbp
* contrib/hbwin/tests/oletst2.hbp
* contrib/hbwin/tests/olesrv2.hbp
* contrib/hbwin/tests/oletst3.hbp
* contrib/hbwin/tests/olesrv3.hbp
* Changed to reference .hbp files instead of libs.
% Deleted redundant settings already supplied
by .hbm files. (if the goal is to make them
current dir independent, we can add a simple
@hbmk.hbm reference to them)
* contrib/hbwin/hbolesrv-mgw.def
* contrib/hbwin/hbolesrv.def
* contrib/hbwin/hbolesrv-ow.def
+ Added SVN ID as comments.
(I hope watcom supports it, if not pls tell)
; TODO: We should somehow merge these into one .def,
even if it requires some extra hbmk2 "magic".
* contrib/hbwin/tests/oletst1.hbp
* contrib/hbwin/tests/olesrv1.hbp
* contrib/hbwin/tests/oletst2.hbp
* contrib/hbwin/tests/olesrv2.hbp
* contrib/hbwin/tests/oletst3.hbp
* contrib/hbwin/tests/olesrv3.hbp
* contrib/hbwin/hbolesrv-mgw.def
* contrib/hbwin/hbolesrv.def
* contrib/hbwin/hbolesrv-ow.def
+ Added SVN props.
* harbour/contrib/hbwin/Makefile
+ harbour/contrib/hbwin/hbolesrv.c
+ added inproc OLE server implementation. It allows to create OLE/ACTIVEX
COM server in Harbour. Such OLE server allows can be used by programs
written in any languages supporting OLE automation (also in other
Harbour applications)
User ole server code should be linked as DLL which later can be
register in MS-Windows by regsvr32.exe program, i.e.:
regsvr32 myolesrv.dll
The OLE server code should contain DLLMAIN() PRG function which
is executed just after loading OLE inproc DLL server as server from
other application and also by regsrv32.exe during registration and
unregistration procedure. It has to initialize at least OLE server
ID and name usinf WIN_OleServerInit().
+ added new PRG function which intitialize OLE server:
WIN_OleServerInit( <cClassID>, <cServerName>, ;
[ <hAction> | <oAction> | <bAction> | <sAction> ], ;
[ <lHashClone> | <lAcceptAll> ] ) -> <lServerActive>
<cClassID> is registered OLE server class GUID
<cServerName> is OLE server class name
<hAction> is optional parameter with hash array containing messages
and instance variables used by OLE server. The keys in hash array
are strings with message names and values are actions. Codeblock
and symbol items means that given message is a method call and
any other value means that it's variable.
By default the same hash array is shared between all objects
created by registered server. It's important when hash array
contains values which are neither codeblock nor symbol items
so they are not used as method but rather as instance variables
because such instance variables are shared between OLE objects.
Setting 4-th parameter <lHashClone> to .T. causes that each
objects receives it's own copy of <hAction> item so instance
variables inside hash array are also local to OLE object.
Alternatively programmer can use <bAction> or <sAction> to create
seprate copy of hash array for each object, i.e.:
bAction := {|| hb_hClone( hValue ) }
When hash array contains symbol item (@funcName()) then when it's
executed by OLE object message it's possible to access the hash
array bound with given OLE object using QSelf() function. It maybe
useful if hash array contains instance variables and programmer
wants to access them.
Please remember that using hash array which was initialized to keep
original assign order by HB_HKEEPORDER( <hAction>, .T. ) before
adding its items you can define strict message numbers (DISPIDs), i.e.:
hAction := {=>}
HB_HKEEPORDER( hAction, .T. )
hAction[ "OPEN" ] := @myole_open() // DISPID=1
hAction[ "CLOSE" ] := @myole_close() // DISPID=2
hAction[ "SAVE" ] := @myole_save() // DISPID=3
hAction[ "LOAD" ] := @myole_load() // DISPID=4
hAction[ "PRINT" ] := @myole_print() // DISPID=5
(see example in olesrv2.prg)
<oAction> is optional parameter with Harbour object which is used
as base for all newly created OLE objects. All messages (method and
instance variables) supported explicitly by <oAction> object (except
ONERROR message redirecting) are inherited by OLE objects. Each
newly created OLE object uses the same <oAction> object so its
instance variables are shared between all of them. If programmer
wants to create separate Harbour object for each OLE object then
he should use <bAction> or <sAction>, i.e.:
bAction := {|| myClass():new() }
<bAction> is optional parameter with codeblock executed when new
OLE object is created. It should return hash array or Harbour object
which will be used as base for newly created OLE object.
<sAction> is optional parameter with function symbol. This function
is executed when new OLE object is created and should return hash
array or Harbour object which is used as base for newly created
OLE object.
If the 3-rd parameter is <oAction>, <bAction> or <sAction> then
it's possible to also set 4-th parameter <lAcceptAll> to .T. and
in such case <xAction> parameter is used in different way. Newly
created OLE object accepts any massage names invoking for each
of them EVAL() message which is sent to <xAction> with OLE message
name inserted as the 1-st item to OLE object parameters.
It allows to create OLE server which will accept unknown messages
redirecting them to some other code, i.e.:
if netio_connect( cServer,,, cPasswd )
WIN_OleServerInit( cClassID, cServerName, @netio_funcExec(), .T. )
endif
initialize OLE server which redirects all messages to default netio
connection establish by netio_connect().
If 3-rd parameter is not given then all HVM functions becomes
OLE methods and HVM memvars (public and private variables) are
OLE object instance variables so they are shared with all OLE
objects created by this interface. It works just like xHarbour.com
OLE server described at
http://xharbour.com/index.asp?page=add_on_oleserver&show_sub=7&show_i=1
; TODO: add support for MT RPC servers. Current implementation cannot
be safely used in MT programs creating OLE objects and executing
their methods simultaneously in different threads without
additional user code which will serialize these operations.
; TODO: replace message handler API in WIN_AxGetControl()/
__AxRegisterHandler() which uses only fixed method IDs
and do not support method names with above one so user
can easy create activex controls which support message
names. This modificaiton will force updating user and 3-rd
party code but IMO should be done. Current interface is
simply too much limited to keep it.
; Possible TODO: add support for user defined fixed message numbers
(DISPIDs) which are not continuous small numbers so
users cannot easy use hash arrays with strict order.
Is such functionality necessary? Can someone with
ActiveX experience say sth about it?
Above implementation has undocumented feature:
it supports hash arrays with keys using numbers only
which can be used like in __AxRegisterHandler() but
I haven't decided yet I should keep, extend or remove
such functionality.
Please make real life test.
I do not have any practice with MS-Windows and OLE and most of above
code I wrote using only documentation so I'm very interesting in real
test results and user opinions about it. If some important functionality
is missing then please inform me about it.
BTW There are some 3-rd party activex implementation for [x]Harbour, i.e.
xharbour.com or FiveWin ones. Maybe someone familiar with them can create
PRG compatibility layer for Harbour. I cannot do that myself because I
do not know that products and their PRG API used in OLE/COM/ActiveX
implementations but if someone can describe it then I can help in such
implementation.
+ harbour/contrib/hbwin/hbolesrv.def
+ harbour/contrib/hbwin/hbolesrv-mgw.def
+ harbour/contrib/hbwin/hbolesrv-ow.def
+ added .DEF link files which are necessary to correctly export
inproc OLE server DLL functions. It's possible that other compilers
or even different versions of the same compilers may use different
a little bit different .DEF files. I tested above with BCC5.5,
MinGW 3.4.5 and OpenWatcom 1.8.
+ harbour/contrib/hbwin/test/olesrv1.prg
+ harbour/contrib/hbwin/test/olesrv1.hbp
+ harbour/contrib/hbwin/test/oletst1.prg
+ harbour/contrib/hbwin/test/oletst1.hbp
+ added example of NETIO-RPC OLE server code with Harbour (PRG) client.
This server redirects all messages sent to its OLE objects to remote
HBNETIO server as function calls. It understands the following
messages:
CONNECT() - creates connection to the server, parameters like in
NETIO_CONNECT() and NETIO_GETCONNECTION() functions
DISCONNECT() - closes current connection
PROCEXISTS() - works like NETIO_PROCEXISTS()
PROCEXEC() - works like NETIO_PROCEXEC()
PROCEXECW() - works like NETIO_PROCEXECW()
FUNCEXEC() - works like NETIO_FUNCEXEC()
All other messages are redirected directly to RPS server as function
calls.
CONNECT() message should be executed by client to create
connection to the server. Each NETIO-RPC OLE object uses its own
connection which should be initialized. If CONNECT() is executed
more then once the current connection is closed.
DISCONNECT() is executed automatically when OLE object is destroyed
so it's not necessary to call it explicitly.
Please use hbmk2 and olesrv1.hbp to compile OLE server. OLE inproc
servers have to export some DLL entry functions which are defined
in .def files which have to be passed to linker.
Before client code can be tested the server has to be registered.
The server can be registered in given MS-Windows system using
regsvr32.exe command. To register the server use:
regsvr32 olesrv1.dll
and to unregister:
regsvr32 /u olesrv1.dll
+ harbour/contrib/hbwin/test/olesrv2.prg
+ harbour/contrib/hbwin/test/olesrv2.hbp
+ harbour/contrib/hbwin/test/oletst2.prg
+ harbour/contrib/hbwin/test/oletst2.hbp
+ added very simple example of OLE server using hash array with
strict item order (associative hash array) to define OLE objects
with fixed message numbers (DISPIDs)
Remember about registering the server by 'regsvr32 olesrv2.dll'
+ harbour/contrib/hbwin/test/olesrv3.prg
+ harbour/contrib/hbwin/test/olesrv3.hbp
+ harbour/contrib/hbwin/test/oletst3.prg
+ harbour/contrib/hbwin/test/oletst3.hbp
+ harbour/contrib/hbwin/test/oletst3.bas
+ added example of OLE server code with Harbour (PRG)
and Visual Basic (BAS) clients.
This server redirects all messages sent to its OLE objects to HVM
functions and messages to HVM memver (public and private) variables
This server should work as xHarbour.com OLE servers described at:
http://xharbour.com/index.asp?page=add_on_oleserver&show_sub=7&show_i=1
The server and clients code are nearly the same so users can easy
compare them.
Remember about registering the server by 'regsvr32 olesrv2.dll'
* contrib/hbwin/win_svc.c
! Fixed callback definitions to be the ones required by Windows.
! Fixed main service entry callback to use TCHAR rather than simple char.
+ Added support to pass service launch parameters to Harbour entry
function.
* contrib/hbwin/tests/testsvc.prg
+ Added code to demonstrate parameter passing feature.
* contrib/hbwin/win_srv.c
* Renamed more variables.
* Moved around hb_strfree() calls to fully avoid the possibility
of freeing string pointers still assigned inside Windows
structures.
! WIN_SERVICESTART() fixed to set last error.
* contrib/hbwin/tests/testsrv.prg
! Fixed to have the default action called
when started without parameter. Required
to make it start when started as service.
+ Test service changed to create a file in
a predictable place (next to .exe) and
fill that with output. Made sure that file is
readable by other processes.
* Cleaned service ID/description.
; I've made successful test with current code.
* contrib/hbwin/win_srv.c
! Fixed static variable types and usage.
! Fixed wrongly used string types.
! Fixed storing temporary pointers to static variables.
Making a copy of the strings instead.
% Deleted unnecessary function declarations.
% Using HB_SIZEOFARRAY() instead of repeating size.
! Fixed variable names to reflect type.
; These fixed previously found errors.
* contrib/hbwin/tests/testsrv.prg
* Replaced ALERT() with '?'.
! Fixed to use HB_TR_ALWAYS to avoid Harbour warning.
% FUNCTION -> PROCEDURE
* doc/howtosvn.txt
+ Made it more clear that 'Chr(36)' should be replaced by '$'.
* ChangeLog
! Stripped accented char. Pls keep all files in 7-bit mode.
* contrib/hbwin/hbwin.ch
* contrib/hbwin/win_srv.c
* contrib/hbwin/tests/testsrv.prg
! Cleanup fixes:
! Fixed missing SVN props (pls see howtosvn.txt and my e-mail today about them)
! Fixed SVN header
! Stripped accented char.
! Deleted <windows.h>.
! Tabs converted to spaces.
! Fixed indentation and formatting.
% Optimized code to have less redundancy.
! Fixed name of static vars.
% Made callbacks static.
! Fixed hbwin.ch constants to have WIN_ prefix.
! Fixed references to unknown functions in test code.
% Test code reworked to have user selectable modes via cmdline parameter.
! Fixed to define all functions also in WinCE mode, but
with dummy functionality.
! Fixed memory potential leak in WIN_SERVICEDELETE().
! Added some casts.
% Variables declarations moved to inner scopes.
; TOFIX:
- UNICODE build problem in hbwin_SrvFunction().
- possible memory corruption in WIN_SERVICESTART()?
- 'implicit declaration of function 'Sets_ServiceStatus'' in hbwin_SrvFunction().
; All the above are shown as mingw warnings.
+ contrib/hbwin/win_srv.c
+ contrib/hbwin/tests/testsrv.prg
* contrib/hbwin/hbwin.ch
* contrib/hbwin/Makefile
+ Basical support for running a harbour application as a windows server.
See tests/testsrv.prg.
* src/common/hbtrace.c
* INSTALL
+ Added trace output support to syslog() for *nix systems
(except watcom builds).
It's enabled by HB_TR_SYSOUT=yes envvar, which now
supercedes previous HB_TR_WINOUT setting.
Windows users pls change HB_TR_WINOUT to HB_TR_SYSOUT.
! Fixed potential problem in HB_TR_WINOUT code, where
the same vararg holder variable was used multiple
times. On *nix this caused GPF. The safest is to make
a copy of it for each usage.
* contrib/hbwin/hbwin.ch
* contrib/hbwin/Makefile
+ contrib/hbwin/tests/testevnt.prg
+ contrib/hbwin/win_evnt.c
+ Added function to add a new event to the Windows event log:
WIN_REPORTEVENT( [<cServerName]>, <cEventLog>,
<nType>, [<nCategory>], [<nEventID>],
<cString> | <acString>, [<cRawData>] ) -> <lSuccess>
* contrib/hbwin/win_prn2.c
! Fixed wce warning.
* utils/hbmk2/examples/contribf.hbc
* utils/hbmk2/examples/contrib.hbc
+ Added minizip lib.
+ config/ren_sfn.prg
- external/bzip2/cnv_hb2o.bat
- external/bzip2/cnv_o2hb.bat
+ external/bzip2/ren_sfn.txt
- external/libhpdf/cnv_o2hb.bat
- external/libhpdf/cnv_hb2o.bat
+ external/libhpdf/ren_sfn.txt
- external/pcre/cnv_o2hb.bat
- external/pcre/cnv_hb2o.bat
+ external/pcre/ren_sfn.txt
+ Replaced .bat method for converting long filenames to
short ones to a .prg script and simple text input file.
Also much of the logic is automatized.
* src/rtl/gtwvt/gtwvt.c
* Minor in old comment.
* INSTALL
- Deleted no more relevant restriction with HB_BUILD_PKG.
* contrib/hbwin/wapi_winuser.c
* contrib/hbwin/hbwin.ch
+ Added WAPI_SETWINDOWPOS() + relevant constants.
+ Added WIN_WS_* constants.
+ Added WAPI_ISICONIC(), WAPI_ISZOOMED().
* contrib/hbwin/tests/testax.prg
! Fixed to compile without warning.
* Using hbwin.ch.
* src/rtl/fstemp.c
! Using hb_fsTempDir() in HB_FTEMPCREATEEX() instead of
old solution. This should fix it for some non-*nix
platforms where *nix specific TEMPDIR envvar was used
to determine temp directory.
* contrib/hbwin/Makefile
* include/Makefile
* src/rtl/Makefile
- contrib/hbwin/hbdyn.ch
+ include/hbdyn.ch
- contrib/hbwin/hbdyn.c
+ src/rtl/hbdyn.c
- contrib/hbwin/win_dllc.c
+ src/rtl/hbdynhb.c
- contrib/hbwin/tests/testdll.c
+ tests/testdyn.c
- contrib/hbwin/tests/testdll.prg
+ tests/testdyn.prg
- contrib/hbwin/tests/testdll1.prg
+ tests/testdyn1.prg
- contrib/hbwin/hbdyn.h
* include/hbapi.h
* Moved dynamic library call related functions to
core (RTL).
* Windows specific test code (currently all) guarded
for platform.
* Changed default calling convention to cdecl.
Tests adaptd accordingly.
* Terminology change: 'dll' -> 'dynamic library'
; HB_DYNCALL() is now part of core Harbour, and it's
platform independent. It's platform (ABI) dependent though,
and currently x64 and x86/stdcall/syscall/cdecl
is supported and these were tested (except OS/2 syscall).
* contrib/hbwin/hbwin.h
* contrib/hbwin/win_misc.c
* contrib/hbwin/legacycd.c
* Low level hbwin_getprocaddress() function moved
to legacy file and made static.
* contrib/xpp/Makefile
* contrib/xpp/dllx.c
* contrib/xpp/xpp.hbc
+ Enabled DLL*() functions for all platforms.
- Deleted dependence on hbwin library.
* contrib/xpp/tests/testdll.prg
* Windows specific parts (currently the whole test) guarded
for platform.
* contrib/hbct/Makefile
- contrib/hbct/diskhb.prg
* contrib/hbct/disk.c
* contrib/xhb/Makefile
+ contrib/xhb/diskhb.prg
* GETVOLINFO() moved from hbct to xhb.
* ChangeLog
* Marked some TODO/TOFIX items as DONE.
* contrib/xpp/Makefile
- contrib/xpp/win_dllx.c
+ contrib/xpp/dllx.c
* contrib/xpp/tests/testdll.prg
+ Adapted Xbase++ compatible DLL*() functions to use
core dynamic lib handling functions.
* Renamed source file, now that it's not Windows specific.
+ Updated tests.
; NOTE: Please review this code. It's the first time I
used GC references in code, and it may be wrong.
; TODO: Remove hbwin dependence after having moved hb_dynCall()
from hbwin to core.
+ contrib/xpp/tests/hbmk.hbm
+ Added missing file from prev commit.
* contrib/hbwin/tests/testdll.prg
* Updated for latest HB_DYNCALL() changes.
* ChangeLog
! Updated WIN_DLLCALL() -> HB_DYNCALL() change.
This is the full list of lost features (all due to
non-portability):
- Specifiying function by (numeric) ordinal.
- Passing function pointer directly.
- Automatic lookup for function names with 'A' and 'W' ending.
- Automatic UNICODE encoding for functions ending with 'W'.
* contrib/hbwin/win_dllc.c
* contrib/hbwin/tests/testdll.prg
* Replaced WIN_DLLCALL() with portable (non Windows-specific)
HB_DYNCALL(), which uses Harbour core function to handle
dynamic libs. This also means there is two former feature lost:
- Specifiying function by (numeric) ordinal.
- Passing function pointer directly.
; TODO: Make the default calling convention cdecl?
; TODO: Move 'hbdyn' subsystem to core after review.
; HB_DYNCALL() should be called as follows:
HB_DYNCALL( <pFunction> | <aFunction>, ... ) -> <xResult>
where <aFunction> can be:
{ <cFunction>, <cLibrary> | <pLibrary> [, <nFuncFlags> [, <nArgFlags1>, ..., <nArgFlagsn> ]] }
where
<nFuncFlags> can be:
hb_bitOr( HB_DYN_CTYPE_*, HB_DYN_ENC_*, HB_DYN_CALLCONV_* )
<nArgFlags*> can be:
hb_bitOr( HB_DYN_CTYPE_*, HB_DYN_ENC_* )
* contrib/hbwin/win_dllf.prg
* Renamed WIN_DLLCALLFOXPRO() to HB_DYNCALLFOXPRO().
* INSTALL
* Changed to use win-make/dos-make in examples.
* contrib/hbwin/win_tbmp.prg
- Deleted XBPBITMAP class mapped to WIN_BMP.
This should be the job of HBXBP.
* contrib/xpp/xpp.hbc
+ contrib/xpp/tests
+ contrib/xpp/tests/testdll.prg
* contrib/xpp/Makefile
+ contrib/xpp/win_dllx.c
* contrib/hbwin/Makefile
- contrib/hbwin/win_dllx.c
* contrib/hbwin/tests/testdll.prg
+ Moved Xbase++ compatible DLL functions to xpp lib.
* INCOMPATIBLE change. If you use these functions (DLL*())
add xpp lib to your lib list.
; Finally we don't have any HB_COMPAT_* dependent parts
in hbwin.
* contrib/hbwin/hbwin.ch
* Changed to use full (0xFF) color components for RGB presets.
* contrib/gtwvg/Makefile
* Deleted trailing spaces.
* ChangeLog
+ Added more description to WIN_DLLCALL() function usage.
* contrib/hbwin/hbdyn.c
+ Type conversion fixes after actual testing.
Now everything should work except float parameter passing
on x64 and passing/receiving unsigned longlongs to/from .dlls
on both x64/x86. I couldn't found how to interact properly
with HVM in this case.
Please review remaining TOFIXes.
+ contrib/hbwin/tests/testdll1.prg
+ contrib/hbwin/tests/testdll.c
+ Added code to test parameter passing.
* contrib/hbwin/legacycd.c
* contrib/hbwin/win_dll.c
+ Forcing stdcall calling convention. (it's the default yet,
but this may change to cdecl).
* contrib/hbwin/win_dll.c
* bUNICODE -> bWIDE.
* contrib/hbwin/hbdyn.ch
+ Added comment.
* include/hbdefs.h
* Typo in comment.
* contrib/hbwin/Makefile
! Added missing hbdyn.h.
* utils/hbmk2/hbmk2.prg
! Fixed to never add double backslash to output dir.
* contrib/hbwin/hbwin.h
* contrib/hbwin/hbwin.ch
* contrib/hbwin/win_dllx.c
* contrib/hbwin/win_dll.c
* contrib/hbwin/legacycd.c
* contrib/hbwin/tests/testdll.prg
+ Reworked WIN_DLLCALL() and low-level hbwin_dllCall() interfaces.
* WIN_DLLCALL() should be called as follows:
WIN_DLLCALL( <pFunction | <aFunction>, ... ) -> <xResult>
where <aFunction> can be:
{ <cFunction> | <nFunction>, <cLibrary> | <pLibrary> [, <nFuncFlags> [, <nArgFlags1>, ..., <nArgFlagsn> ]] }
{ <pFunction> [, <nFuncFlags> [, <nArgFlags1>, ..., <nArgFlagsn> ]] }
With above API it's possible to access all low-level options and
merge all possible call types in one call. If passing function ordinal
or name, it will also autodetect UNICODE mode. Autodetection turns
on UNICODE mode for WinCE permanently and for functions ending with 'W'.
* Call convention, C type and unicode flags are now merged into one
callflag value.
* Unicode flag extended to RAW, ASCII, UTF8, UTF16.
+ Added support for UTF-8 and forced raw encoding for char pointer types.
* GETPROCADDRESS() finally moved to legacy source.
* contrib/hbsms/hbsms.prg
! Fixed SMS_SEND() to return numeric value when port couldn't
be opened.
* contrib/hbwin/win_dll.c
! Fixed to unshare all HVM strings before passing them to callee.
* contrib/hbwin/tests/testdll.prg
! Deleted two commented test call, which corrupted memory anyway
due to too small buffer passed to low-level function.
* contrib/hbwin/win_dll.c
% Optimization steps.
* Syncing between win64/win32 sections.
* contrib/hbwin/tests/testdll.prg
+ Added new tests, but they GPF due to corrupted internals,
so they are commented for now.
* include/hbdefs.h
* HB_BYTE made a synonym for HB_UCHAR.
HB_BYTE is only there for convenience, HB_UCHAR is recommended
for unsigned byte streams.
* HB_U8 now based on HB_UCHAR.
! Fixed UINT64/INT64 left defined in some cases.
* contrib/hbwin/hbwin.h
* contrib/hbwin/hbwin.ch
* contrib/hbwin/tests/testdll.prg
* contrib/hbwin/win_dll.c
* contrib/hbwin/legacycd.c
+ Added LONGLONG C types.
+ Added support for user-specifiable parameter types.
This works now in low-level C dll call function and also
on high level in HB_DLLCALL().
+ Added support for LONGLONG/int64 integers.
+ Added support for raw strings. (no UNICODE or codepage
conversion).
! Fixed typo in iRetTypeRaw assigment.
+ Added one new test for param type spec test. (pretty bare)
! Fixed WAPI_GETPROCADDRESS() to GETPROCADDRESS(). Latter
has some extra features so we still need it.
* GETPROCADDRESS() moved back to non-compatibility.
; Please review the code. There are some integer conversion
which might not be proper (& 0xFFFF).
* utils/hbmk2/hbmk2.prg
! Typo in recently added help text.
* contrib/Makefile
- contrib/hbbmcdx
+ contrib/rddbmcdx
* contrib/rddbmcdx/bmdbfcdx.c
* contrib/rddbmcdx/Makefile
* Renamed hbbmcdx to rddbmcdx.
* More cleanup to RDD code. (sync with rddcdx, deleted
unnecessary lines)
- Deleted "turbo" functionality. BM_TURBO() is now a dummy.
AFAIR this isn't safe, and even if it is it should be
implemented differently, not as a static variable.
* contrib/hbwin/Makefile
* contrib/hbwin/win_dll.c
+ contrib/hbwin/win_dllx.c
* contrib/hbwin/legacycd.c
+ Moved LOADLIBRARY(), FREELIBRARY() and GETPROCADDRESS() to legacy source.
+ Moved Xbase++ compatibel DLL interface to separate Xbase++ specific file.
; From now on the recommended native DLL interface for Harbour apps is:
WAPI_LOADLIBRARY(), WAPI_GETPROCADDRESS(), WAPI_FREELIBRARY() and
WIN_DLLCALL()
; TODO: Solve GC collected HMODULE in above WAPI LIB handling functions.
; TODO: Clean HB_LIB*() vs. WAPI LIB handling confusion.
* contrib/hbwin/tests/testdll.prg
* Changed to use WAPI_LOADLIBRARY()/WAPI_FREELIBRARY()
! Fixed one remaining CALLDLLTYPED() call.
- Deleted no more valid comment about not-working libcurl .dll call.
Now it works.
* contrib/hbwin/hbwin.ch
+ Added HB_WIN_DLL_CALLCONV_* macros. (so far only privately defined inside .c code)
+ Added HB_WIN_DLL_CTYPE_* macros. (so far only privately defined inside .c code)
+ Reworked HB_WIN_DLL_CTYPE_* macro values. INCOMPATIBLE. Since they weren't
previously documented, this should not be a breakage, pls report it if this is
a problem.
! Fixed .ch syntax to also work in .c files.
* contrib/hbwin/hbwin.h
* contrib/hbwin/legacycd.c
* contrib/hbwin/win_dll.c
* contrib/hbwin/tests/testdll.prg
* Using hbwin.ch for callconv and C type constants.
+ Added public low-level interface: hbwin_dllCall().
This has provision for exact parameter type specification.
* Changed Harbour level functions to use new public
interface hbwin_dllCall().
+ Moved CALLDLL(), CALLDLLBOOL(), CALLDLLTYPED() to legacy source.
* HB_DLLEXEC structure made private to XPP compatibility
section.
+ Added new WIN_DLLCALL() API. This can replace all old CALL*()
function and give more flexibility. Its first parameter is an
optional array, which can specify calling convention (it was
fixed in old implementation), return type and UNICODE swicth,
plus it has provision to specify parameter types, too.
+ Changed test app to use new WIN_DLLCALL() API.
* hb_getprocaddress() made public (but not exported) and
renamed to hbwin_getprocaddress().
* config/wce/mingwarm.mk
* config/win/mingw.mk
- Deleted hack to always add frame buffer for hbwin.
It's not necessary anymore.
* src/rtl/direct.c
* int -> HB_SIZE
* contrib/hbwin/wapi_wingdi.c
! Fixed return value of WAPI_SELECTOBJECT()
* contrib/hbwin/tests/testdll.prg
+ Minor.
* contrib/hbwin/win_dll.c
! Fixed typo in byref parameter handling. Thanks to
Xavi for noticing it.
* Deleted unused union members from win32 retval support,
renamed the rest.
* utils/hbmk2/hbmk2.prg
+ Added -3rd= option. This is always ignored by hbmk2 and it
allows to store extra, non-hbmk2 information in hbmk2 make files.
F.e.: -3rd=-hbide_friendlyname=MyProject
* contrib/hbwin/hbwapi.h
* contrib/hbwin/wapi_alloc.c
* contrib/hbwin/wapi_wingdi.c
* contrib/hbwin/tests/testgdi.prg
+ Reworked the way DEVMODE structure is handled. As many winapi
interfacing methods, this is also a strange beast, it contains
some hidden information, so it must be created using some
winapi calls. I finally settled with these three functions
to handle DEVMODE structure from .prg level:
__WAPI_DEVMODE_NEW( <cPrinterName> ) => <pDEVMODE>
__WAPI_DEVMODE_SET( <pDEVMODE>, <hashToWriteFrom> )
__WAPI_DEVMODE_GET( <pDEVMODE>, <hashToReadInto> )
Then <pDEVMODE> can be passed to WAPI_CREATEDC() and WAPI_RESETDC().
Remember to recreate <pDEVMODE> after using __WAPI_DEVMODE_SET()
and before using __WAPI_DEVMODE_GET() to refresh the structure
content with actual device settings.
* contrib/hbwin/wapi_wingdi.c
- Dropped array support for DOCINFO parameter.
; Array has only any point for really simple/obvious structures
like point and rect, for anything more complicated hash is
a much convenient answer (don't have to remember structure
member positions, can pass them in any order and combination,
and MSDN docs can be used when coding .prg for Windows).
* contrib/hbwin/tests/testgdi.prg
% Inlined DOCINFO hash parameter syntax.
* contrib/hbwin/hbwapi.h
* contrib/hbwin/wapi_wingdi.c
! Fixed potential GPD in hbwapi_par/stor*() functions
when parameter was not passed at all.
+ Added hbwapi_par_DOCINFO() and hbwapi_strfree_DOCINFO()
pairs to retrieve structures with strings in them.
Hashes are supported now as well.
; TODO: Low-level string handling functions will GPF
yet if the related hashes are missing (f.e. in
posted test code). This requires proposed extra
guards in low-level string functions.
+ WAPI_STARTDOC() changed to use hbwapi_par_DOCINFO().
% Minor cleanup in WAPI_SELECTOBJECT().
+ contrib/hbwin/tests/testgdi.prg
+ Added test code for GDI function structure parameter exchange.
* contrib/hbide/idethemes.prg
* contrib/hbide/ideeditor.prg
+ Added 'sequence' and 'endsequence' to keywords.
; TOFIX: try/catch and a few more are not Harbour keywords.
* contrib/hbide/ideeditor.prg
% Optimized low-level keyword lookup functions:
- Use hashes instead of arrays and ascan.
- Use STATIC vars to avoid rebuilding tables on every call.
* contrib/hbwin/win_tprn.prg
* contrib/hbwin/win_prn1.c
+ WIN_CREATEFONT() extended with 10th parameter which makes
it possible to switch to raw height/width specification.
This is crucial for precise positioning using integer
parameters. Not very elegant parameter, but this class
and low-level interface is already extremely hacky so this
won't really make it any worse.
+ WIN_PRN():SetFont() extended with lManualSize option which
maps to above 10th parameter.
* contrib/hbwin/tests/testprn.prg
+ Added some text on the solution for overwritten underline
problem described in test program.
* contrib/hbwin/win_reg.prg
* contrib/hbwin/win_os.prg
* contrib/hbwin/win_tprn.prg
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/hbwin.h
* contrib/hbwin/hbwin.ch
* contrib/hbwin/tests/testprn.prg
* contrib/hbwin/tests/testcom1.prg
* contrib/hbwin/tests/testcom2.prg
* contrib/hbwin/tests/testreg.prg
* contrib/hbwin/tests/testmapi.prg
* contrib/hbwin/win_com.c
* contrib/hbwin/win_prn1.c
* MM_TO_INCH macro moved from hbwin.ch to win_tprn.prg.
(INCOMPATIBLE is someone happened to use this in app code)
+ Prefixed all Windows constants with WIN_ in hbwin.ch.
+ Prefixed all hbwin specific constants with HB_ in hbwin.ch.
+ Retained all old legacy / deprecated hbwin.ch constants
for compatibility. Users are encourages to use the new
ones, as the old ones will be deleted in the future.
* Changed WIN_MULDIV() to use hb_retni() (instead of hb_retnl())
* WIN_MULDIV() renamed to WAPI_MULDIV() and moved
to wapi source. (INCOMPATIBLE, although it's unlikely anyone
is using WIN_MULDIV() so I didn't keep it.)
+ Added some additional printing related Windows constants.
+ Added comments to hbwin.ch saying which constant is used
in which WIN_*() function.
* HB_WIN_MAPI_* constants renamed to WIN_MAPI_*.
(I haven't dealt with compatibility as this is brand new
functions with not much users yet)
+ Marked all hbwin.ch deprecated macros with HB_LEGACY_LEVEL3
! Fixed to use hbwin.ch constants in few remaining places in testprn.prg
; Now it's possible to include hbwin.ch in .c files.
; QUESTION: Why RGB_* color constants aren't using pure colors?
If there is no special reason, I think it should be
changed to pure ones (with 0xFF components).
* src/compiler/hbgenerr.c
* Formatting.
* contrib/hbhpdf/harupdf.c
! HPDF_Page_TextWidth() fixed to return double instead of long.
As suggested by Francesco Perillo.
* contrib/hbwin/hbwin.ch
* contrib/hbwin/tests/testprn.prg
+ Renamed FORM_* to WIN_PRN_DMPAPER*.
(old constants are still there for compatibility.
+ Added new WIN_PRN_DMPAPER* constants. (the list is far
from complete, but my first goal was to be about in sync
with hbhpdf)
* contrib/hbnetio/tests/netiotst.prg
! Fixed to REQUEST dir related functions to avoid RTE.
- contrib/hbnetio/tests/data
- Deleted. Now it's created by RPC call.
* contrib/hbwin/tests/testprn.prg
* Formatting.
* contrib/hbwin/win_prn1.c
! Using constants for dmOrientation.
* contrib/hbqt/hbqt.ch
* contrib/hbxbp/xbp.ch
+ Using HB_TRACE() macro. This means that now .prg level
trace messages have to be enabled the standard way, __HB_DEBUG__
has no meaning anymore.
* contrib/hbwin/tests/testwmtx.prg
- Deleted some bits added by me as per Xavi's suggestions.
* contrib/hbwin/tests/testdll.prg
* contrib/hbwin/win_dll.c
+ Added support for passing parameters by reference in win64 mode.
+ Added logic to detect UNICODE mode. Enabled only in win64.
! One regression fixed in previous version (in non-win64 mode).
! Fixed default return to be the same in win64 as in non-win64 mode.
; TOFIX: Strings passed by reference seems to be wrong.
; TOFIX: UNICODE support for string passed by reference doesn't work.
; Please test/review and contribute to this, current state is pretty
much the extent I'm willing and capable of implementing this.
* contrib/hbwin/hbwin.ch
* contrib/hbwin/tests/testmapi.prg
* contrib/hbwin/mapi.c
+ Added HB_WIN_MAPI_* constants for recipient types.
+ WIN_MAPISENDMAIL() now accept 8th (sender) as simple string,
this will be passed as sender name to Windows.
+ WIN_MAPISENDMAIL() now accept 9th (recipient) parameter
as simple list of strings. Values will be passed as
'TO' recipient names to Windows.
+ WIN_MAPISENDMAIL() now accept 10th (attachment) parameter
as simple list of strings. Values will be passed as
pathname to Windows.
% One minor optimization in WIN_MAPISENDMAIL().
+ Added example for simple form of WIN_MAPISENDMAIL() call.