* src/vm/runner.c
! Minor to prev.
* include/hbapi.h
* src/vm/extend.c
+ Added hb_parnsize(), hb_retnsize(), hb_stornsize() functions.
; NOTE: These should be used in place of hb_parnl(), hb_retnl(),
hb_stornl() when passing HB_SIZE types.
; TODO: Use them all accross Harbour if they are correct and
after being finalized.
* src/vm/itemapi.c
+ Added hb_itemGetNSize(), hb_itemPutNSize() functions.
* DATETIME stuff in hb_itemGetNL() marked as HB_LEGACY_LEVEL3.
; QUESTION: It's marked as to be deleted in the TODO, so maybe we should
rather delete it.
* include/hbapiitm.h
* src/rtl/filesys.c
+ hb_fsReadAt(), hb_fsWriteAt(): Added support for Win64 HB_SIZE.
; QUESTION: I assume these functions have the purpose of being
atomic seek + read without moving the file pointer,
which means current modification isn't safe. How
can this be solved given Windows doesn't seem to have
64-bit read/write API calls?
! Fixed old copy-paste typos in Windows OVERLAPPED initialization,
where the lines were ended with command instead of semicolon,
they didn't cause any harm though in their former location.
% Reverted a minor change from prev commit to make it
possibly a little bit faster, like it was before.
* src/rtl/hbzlib.c
+ Added casts (at external interface calls) and other fixes to
make it build for Win64 without warnings.
* src/rdd/dbfntx/dbfntx1.c
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/dbffpt/dbffpt1.c
* contrib/rddbmcdx/bmdbfcdx.c
* HB_ULONG -> HB_SIZE where appropriate to avoid Win64 errors
and some warnings. I'm still not comfortable to touch this
code, but it could certainly need a type cleanup.
* include/hbdefs.h
+ Added HB_PFS macro which holds the printf() format string
for HB_SIZE value.
; TODO: Use it all accross Harbour.
* contrib/hbmysql/mysql.c
* contrib/sddmy/sddmy.c
* contrib/hbmzip/hbmzip.c
* contrib/hbcurl/hbcurl.c
* contrib/hbhpdf/harupdf.c
* contrib/hbpgsql/postgres.c
* contrib/rddads/adsfunc.c
* contrib/rddads/ads1.c
* contrib/hbfimage/fi_wrp.c
* contrib/sddodbc/sddodbc.c
* contrib/hbgd/gdwrp.c
* contrib/hbwin/wapi_wingdi.c
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/wapi_winuser.c
* contrib/hbwin/win_bmp.c
* contrib/hbwin/win_prn1.c
* contrib/hbwin/win_regc.c
* contrib/hbssl/evpciph.c
* contrib/hbssl/ssl.c
* contrib/hbssl/bio.c
* contrib/hbssl/sslctx.c
* contrib/hbssl/evpenc.c
* contrib/hbssl/pem.c
* contrib/hbssl/rand.c
* contrib/hbssl/evp.c
+ Added necessary casts at external component boundaries to
make Win64 builds warning-free.
* contrib/hbct/ctstrfil.c
+ HB_ISIZ -> HB_FOFFSET, hb_fsSeek() usage, other type cleanup
to handle file offsets correctly.
* contrib/xhb/hbnxs.h
* contrib/xhb/hbcrypt.c
! Fixed warnings for Win64.
* contrib/hbwin/win_prn3.c
* contrib/xhb/dbf2txt.c
* contrib/xhb/fparse.c
* int -> HB_ISIZ for Win64.
* contrib/xhb/freadlin.c
* hb_fsSeek() -> hb_fsSeekLarge().
* contrib/sddfb/sddfb.c
* Minor type cleanup to make Win64 warning-free.
* contrib/hbsqlit3/hbsqlit3.c
+ Added necessary casts at external interface calls.
% Deleted one dummy operation from SQLITE3_FILE_TO_BUFF().
* contrib/rddsql/sqlmix.c
* contrib/rddads/adsx.c
* HB_ULONG -> HB_SIZE.
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/wvggui.c
* contrib/gtwvg/wvgcuig.c
* contrib/gtwvg/wvgwin.c
* contrib/gtwvg/wvgutils.c
* contrib/gtwvg/wvgcore.c
! int -> HB_ISIZ/HB_SIZE
+ Added necessary casts at external component boundaries to
make Win64 warning-free.
* contrib/rddads/ads1.c
* HB_ULONG -> HB_SIZE
* contrib/hbtip/utils.c
* int -> HB_ISIZ
! Fixed to use HB_FOFFSET type to save/restore file position.
* ChangeLog
+ Added missing item to previous log entry:
! Fixed hb_fsCurDirBuff() for Win64.
; It's quite large commit, nevertheless I'd highly appreciate
peer review, and certainly there will be places which need
better or different solution for Win64.
* include/hbdefs.h
! Fixed one intentional typo I put in to test legacy types.
* src/compiler/hbmain.c
* src/compiler/genhrb.c
* src/compiler/gencc.c
* src/compiler/hbcmplib.c
* include/hbcomp.h
* include/hbcompdf.h
* HB_ULONG -> HB_SIZE, where I could find out from warnings.
+ Added parameter names to some function declarations where they
were missing.
; Przemek, please check me. I feel I will mess this up if continuing
beyond this point, so I'd appreciate if you could take a look at
HB_ULONG to HB_SIZE conversion from an intrinsic perspective,
there seem to be places where it needs further tweaks to get us
full Win64 support. [ I've also intentionally left this area
more or less intact when doing the previous pass of conversion. ]
; There are places where simple 'int' is used, while it should be
HB_SIZE (or maybe size_t? in some places).
; Also, Win64 conversion will need some more work f.e. in filesys.c
where WinAPI file I/O functions can't accept a 64-bit value.
First I will report these and if they seem complicated I'll
revert to HB_SIZE = HB_ULONG for Win64 in the being.
* src/compiler/hbgenerr.c
* Formatting.
* src/pp/ppcore.c
* src/vm/strapi.c
* src/vm/debug.c
* src/vm/itemapi.c
* src/vm/cmdarg.c
* src/vm/set.c
* src/debug/dbgentry.c
* src/common/hbgete.c
* src/common/hbstr.c
* src/common/strwild.c
* src/nortl/nortl.c
* src/rtl/lennum.c
* src/rtl/strmatch.c
* src/rtl/gtstd/gtstd.c
* src/rtl/hbstrfmt.c
* src/rtl/transfrm.c
* src/rtl/gtcgi/gtcgi.c
* src/rtl/direct.c
* src/rtl/filesys.c
* src/rtl/console.c
* src/rtl/hbgtcore.c
* src/rtl/cdpapi.c
* src/rtl/mlcfunc.c
* src/rtl/itemseri.c
* src/rtl/gtpca/gtpca.c
* src/rtl/trace.c
* src/rtl/samples.c
* src/rtl/gete.c
* src/rdd/workarea.c
* src/rdd/hsx/hsx.c
* src/rdd/hbsix/sxsem.c
* src/rdd/hbsix/sxfname.c
* contrib/hbct/tab.c
* contrib/xhb/dbf2txt.c
* contrib/xhb/datesxhb.c
* contrib/xhb/dbgfxc.c
* contrib/hbmzip/hbmzip.c
* contrib/hbnf/fttext.c
* contrib/hbnetio/netiocli.c
* contrib/hbpgsql/postgres.c
* contrib/hbclipsm/num.c
* contrib/rddads/ads1.c
* contrib/sddsqlt3/sddsqlt3.c
* contrib/hbfimage/fi_wrp.c
* contrib/sddodbc/sddodbc.c
* contrib/sddoci/sddoci.c
* contrib/hbwin/win_svc.c
* contrib/hbwin/win_prn2.c
* '( HB_SIZE ) strlen(' -> 'strlen('
* INSTALL
* config/global.mk
* config/detfun.mk
* config/detect.mk
* external/sqlite3/Makefile
* external/png/Makefile
* external/jpeg/Makefile
* external/bzip2/Makefile
* external/libhpdf/Makefile
* contrib/hbsqlit3/Makefile
* contrib/hbmzip/Makefile
* contrib/hbbz2/Makefile
* contrib/hbhpdf/Makefile
* contrib/sddsqlt3/Makefile
* contrib/hbwin/Makefile
+ Added HB_ROOT variable which can be used to specify Harbour
source tree root as an absolute directory, when using
older than 3.81 GNU Make version (f.e. on QNX).
+ Changed the way locally hosted source directories are
specified for detection function, in order to support
HB_ROOT functionality.
* harbour/include/hbdefs.h
* harbour/include/hbvmpub.h
* harbour/src/common/expropt1.c
* harbour/src/common/expropt2.c
* harbour/src/common/hbstr.c
* harbour/src/compiler/gencc.c
* harbour/src/vm/hvm.c
* harbour/src/vm/itemapi.c
* harbour/src/vm/task.c
* harbour/src/rtl/abs.c
* harbour/src/rtl/hbdyn.c
* harbour/src/rdd/dbsql.c
* harbour/contrib/hbwin/olecore.c
* harbour/contrib/sddoci/sddoci.c
* harbour/contrib/sddsqlt3/sddsqlt3.c
* renamed HB_LONG_{MIN,MAX} to HB_VMLONG_{MIN,MAX} and
HB_INT_{MIN,MAX} to HB_VMINT_{MIN,MAX} to not confuse users
after renaming HB_LONG to HB_MAXINT and LONG to HB_LONG.
They could expect that HB_LONG_{MIN,MAX} are for HB_LONG type.
* contrib/gtwvg/gtwvg.h
* contrib/gtwvg/wvggui.h
* contrib/hbwin/win_shell.c
! Fixed MinGW-w64 cross compiler detection with the recommended "official" method.
MinGW-w64 can also compile for x86, in this case are the same built-in macros.
* contrib/hbwin/win_shell.c
+ Added protection to typedef SHNAMEMAPPING, LPSHNAMEMAPPING for MINGW64.
MinGW-W64 provides these definitions and cause error when building hbwin.
* 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.
* utils/hbmk2/hbmk2.prg
! Fixed silly variable initialization bug after last commit.
* contrib/hbwin/wapi_shellapi.c
! Fixed WAPI_SHELLEXECUTE() having HB_PARSTRDEF() one
position off.
* examples/rddado/tests/access1.prg
* Minor update. Still doesn't work.
* 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.
* utils/hbmk2/hbmk2.prg
+ Added ${hb_filename} macro.
+ "hbexe", "hblib", "hbdyn", "hbdynvm", "hbimplib" can now
be used as filter keywords to detect target type.
* contrib/hbwin/hbolesrv.hbc
+ Will now show warning message if not used together with
-hbdynvm option.
+ Will will now be ignored if not used together with
-hbdynvm option.
; Tried to add hbolesrv.c as direct source 'sources=hbolesrv.c',
but it requires this source (+ headers) to be distributed along
the binaries, plus it didn't resolve the watcom issue, so
I dropped it.
* 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/hbmisc/Makefile
+ contrib/hbmisc/calldll.prg
+ Added CALLDLL compatibility API interface:
CALLDLL32(), HB_DYNACALL1(), STRPTR(), PTRSTR(), UNLOADALLDLL().
; Lightly tested, it's based on core .dll functions, so it may only
need easy tweaking. Notice that this API support all platforms,
not just 32-bit Windows.
The original library is found in MINIGUI f.e.
* contrib/hbwin/win_shell.c
* Minor formatting.
* 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.
* harbour/contrib/hbwin/hbolesrv.c
% improved the performance and reduced memory usage by using hash
array with strict assign order for message names to number translation
in OLE objects accepting any message names
* harbour/contrib/hbwin/hbwinole.h
* harbour/contrib/hbwin/olecore.c
* modified hb_oleVariantUpdate() parameters
+ added automatic conversion of HVM objects to OLE objects for
for parameters passed by reference to Harbour OLE server methods.
* harbour/contrib/hbwin/hbolesrv.c
+ added automatic conversion of HVM objects to OLE objects for
memvars redirected to OLE instance variables.
! fixed typo
* include/hbapifs.h
+ Added some more HB_EXPORT flags. Pls check me.
* contrib/hbwin/hbolesrv.hbc
+ Added reference to hbwin.hbc, so that it can be used
standalone accompanied by -hbdynvm option to create
OLE servers easily: 'hbmk2 -hbdynvm hbolesrv.hbc ...'
* contrib/hbwin/hbolesrv-watcom.def
! Fixed comments to watcom format.
* utils/hbmk2/hbmk2.prg
! Fixed RTE when parsing certain rarer Windows file types
in sources= directive in .hbc files in *nix hbmk2 builds.
(could only kick in when using hbmk2 under *nix to cross
compile for Windows). Thanks Przemek for the report.
- Deleted doubly added support for .def file parsing in sources=
directive.
* harbour/contrib/hbwin/hbwinole.h
! fixed typo in added extern declarations
* harbour/contrib/hbwin/hbwinole.h
* harbour/contrib/hbwin/axcore.c
* harbour/contrib/hbwin/olecore.c
* harbour/contrib/hbwin/hbolesrv.c
+ added support for automatic conversion of HVM objects returned by
Harbour OLE server methods to OLE objects.
Please test. I cannot make any tests now.
; TODO: if it works then update this code to create some more general
version.
* 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'
* harbour/include/hbapi.h
* harbour/src/vm/hashes.c
* harbour/src/vm/hashfunc.c
+ added support for keeping strict assign order in hash arrays. It's
enabled optionally by setting HB_HASH_KEEPORDER hash array flag.
It gives the same functionality as associative arrays in xHarbour
(enabled by HSETAACOMPATIBILITY()) but this implementation is
internally completely different. It does not introduce linear
scan in add operation so enabling it should not reduce the
performance in this operation. It can even improve it on some
hardware reducing number of memory bytes which have to be moved.
Only delete operation will force linear index scan. The most
important in this implementation is that it does not need any
additional functions like HAA*() in xHarbour. Just simply all
existing functions operating on position indexes like HB_HPOS(),
HB_HKEYAT(), HB_HVALUEAT(), HB_HPAIRAT(), HB_HDELAT(), HB_HSCAN()
use as index natural order in which items were added to hash array.
Also HB_HKEYS(), HB_HVALUES() and FOR EACH iterations respect it.
+ added new PRG functions
HB_HKEEPORDER( <hValue> [, <lNewSetting> ] ) -> <lPrevSetting>
HB_HSETORDER( <hValue> [, <lNewSetting> ] ) -> <hValue>
which cam be used to enable/disable strict order in hash array.
Enabling strict order for non empty hash arrays accept the order
created after sorting existing item not the original assign order.
Disabling strict order for non empty hash arrays may change the
items order.
; TODO: add translation for xHarbour's HAA*() functions to hbcompat.ch
and/or xhb library.
* harbour/contrib/hbnetio/netiocli.c
* harbour/contrib/hbnetio/netiosrv.c
% reenabled TCP_NODELAY on client and server side
I had to be really tired when I was making tests and I mixed
hb_socketSetNoDelay() with hb_socketSetBlockingIO().
Thanks to Aleksander Czajczynski who noticed the delay in his
tests.
* harbour/contrib/hbwin/olecore.c
* minor cleanup
* contrib/hbwin/win_svc.c
+ WIN_SERVICEINSTALL(): Extended to accept 3rd parameter
for the full filename of the service executable. This
makes it possible to install other .exes not just self.
* harbour/src/rdd/dbf1.c
* minor cleanup
* harbour/include/hbapi.h
+ added new macro HB_IS_EVALITEM() - returns true for items which can
understand EVAL message i.e. CODEBLOCK and SYMBOL items.
* harbour/contrib/hbwin/axcore.c
* harbour/contrib/hbwin/olecore.c
* harbour/contrib/hbwin/hbwinole.h
* modified hb_oleDispInvoke() function to accept as additional
parameter pointer to HVM item instead of pointer to DISPID.
Such version is more universal.
* harbour/include/hbvm.h
* harbour/src/vm/hvm.c
+ added new C function hb_vmIsActive()
* harbour/src/rtl/memvarhb.prg
! fixed procedure returning value
! store only simple variables in HB_MVSAVE() just like __MSAVE()
Possible extension: add option to store also NIL, arrays, hashes
and maybe object variables.
! restore variables in HB_MVRESTORE() as private ones just like
__MVRESTORE()
* harbour/contrib/hbwin/oleinit.c
* harbour/contrib/hbwin/olecore.c
* updated to compile and link in WinCE builds. Now code using OLE
can be linked with MinGWCE builds without any errors but I have
no idea if it works. Can someone check it?
* config/postinst.prg
+ Added new experimental envvar:
HB_BUILD_ADDONS=prj1.hbp prj2.hbp prjn.hbp
Harbour build process will initiate the build of the passed
.hbp files at 'install' phase.
% Simplification to other hbmk2 invocation commands.
* contrib/hbwin/win_svc.c
! Fixed to set running status only if entry function
is valid and able to reenter HVM.
+ Added trace message when entry function cannot be found.
* 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
* More clearing up.
* contrib/hbwin/win_srv.c
! Fixed one TOFIX which was result of s&r on my part.
; TOFIX remaining:
---
../../../win_srv.c: In function 'hbwin_SrvFunction':
../../../win_srv.c:102:4: warning: passing argument 1 of 'RegisterServiceCtrlHandlerW' from incompatible pointer type
f:\devl\mingw-450\bin\../lib/gcc/mingw32/4.5.0/../../../../include/winsvc.h:234:40: note: expected 'LPCWSTR' but argument is of type 'char *'
../../../win_srv.c: In function 'HB_FUN_WIN_SERVICESTART':
../../../win_srv.c:279:21: warning: assignment from incompatible pointer type
../../../win_srv.c:280:21: warning: assignment from incompatible pointer type
---
* 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.
* harbour/contrib/hbwin/olecore.c
! added protection against possible buffer overflow when more then
32 parameters is passed by reference from foreign code - thank to
Mindaugas for locating the problem.
* harbour/contrib/hbwin/hbwinole.h
* harbour/contrib/hbwin/olecore.c
+ added new C function hb_oleDispInvoke()
* harbour/contrib/hbwin/axcore.c
* use hb_oleDispInvoke() - please test if activex controls still work
correctly