On Sat, 09 Feb 2008, Pritpal Bedi wrote: > Hello Everybody > Has anybody been able to use xHarbour's win32ole.prg in Harbour ?
The ported version is in hbw32 library in w32_ole.c and w32_tole.prg files. It's xHarbour's win32ole.prg code with some minor fixes AFAIR even synced with recent xHarbour's modifications. But please remember that this code inherited very serious problem from xHarbour. If you are using BCC then it will need -a8 alignment for OLE structures but it also access directly HB_ITEM internals (it needs to include hbvmopt.h) so you have to compile also whole Harbour core code with such alignment. It causes general slowness because [x]Harbour HVM is slower when compiled with -a8 by BCC then with -a4. It's sth what have to be definitely fixed because it can also can be source of other problems which cannot be resolved at all. F.e. commercial libraries can be also alignment dependent and compiled with different alignment, f.e. -a4 and in such case you will not be able to produce single binaries. > I am in a process of porting an huge application which is heavily based on > Active-X's. The application takes advantage of FreeWin (SourceForge) library > and hosts many objects. I am struck at hb_oleItemToVariant() and > hb_oleVariantToItem() functions which is used in FreeWin's AxEv.c and are > not available in Harbour. > Can someone convert these function to honor Harbour API ? Fixing above alignment problem in xHarbour will also resolve the problem of compilation in Harbour. Just simply by default Harbour forbids danger operation and it's the reason why this code cannot be compiled. So far no one tries to make it. In fact exactly these to functions hb_oleItemToVariant() and hb_oleVariantToItem() should be rewritten to not access item internals and this should resolve the problem. If the alignment problem is unimportant for you then you can use hacked version from hbw32 as is with Harbour compiled with -a8. If you want to fix the problem then look at places marked with TOFIX in contrib/hbw32/w32_ole.c - probably such fix can be also valuable for xHarbour users. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour