From efb85b04d2d33d557b4350abbf3d8bdc6998ee25 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 15 Jun 2009 08:39:38 +0000 Subject: [PATCH] 2009-06-15 10:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/legacy.prg ! Trying to implement TOLEAUTO():NEW() compatibility interface. Crash is gone, but I'm not sure the app now behaves perfectly. Someone please review/test. --- harbour/ChangeLog | 17 ++++++++++++----- harbour/contrib/hbwin/legacy.prg | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 12ac40bd06..83e932050e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-15 10:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/legacy.prg + ! Trying to implement TOLEAUTO():NEW() compatibility + interface. Crash is gone, but I'm not sure the app + now behaves perfectly. + Someone please review/test. + 2009-06-15 00:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbxbp/Makefile @@ -44,15 +51,15 @@ + Added implementation code of above classes. /* - demoXBP.prg implements 100% Xbase++ code pulled from its + demoXBP.prg implements 100% Xbase++ code pulled from its documentation. The only attributes changes are done either to redefine the parent or window coordinates. Xbase++ ( as I know ) - takes bottom-top approach in screen coordinate system, so + takes bottom-top approach in screen coordinate system, so demoXBP.prg compiled with Xbase++ shows objects in different positions. Except for this and a couple of other compatibility - issues, Harbour offers more wider horizon. So, once base - implementation is done, I may extend these classes to take - advantage of QT's powerful design concepts. + issues, Harbour offers more wider horizon. So, once base + implementation is done, I may extend these classes to take + advantage of QT's powerful design concepts. */ 2009-06-15 10:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/contrib/hbwin/legacy.prg b/harbour/contrib/hbwin/legacy.prg index 16803582b4..0ee838ef4a 100644 --- a/harbour/contrib/hbwin/legacy.prg +++ b/harbour/contrib/hbwin/legacy.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Compatibility calls. * - * Copyright 2009 {list of individual authors and e-mail addresses} + * Copyright 2009 Viktor Szakats (harbour.01 syenar.hu) * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -54,10 +54,30 @@ #include "hbclass.ch" +#include "common.ch" + CREATE CLASS TOLEAUTO FROM WIN_OLEAUTO /* TODO: Implement compatibility to the required extent */ + METHOD New( xOle, cIID ) ENDCLASS +METHOD New( xOle, cIID ) CLASS TOLEAUTO + + IF ISNUMBER( xOle ) + xOle := win_N2P( xOle ) + ENDIF + + IF hb_isPointer( xOle ) + ::__hObj := xOle + ELSEIF ISCHARACTER( xOle ) + xOle := __OleCreateObject( xOle, cIID ) + IF ! Empty( xOle ) + ::__hObj := xOle + ENDIF + ENDIF + + RETURN Self + CREATE CLASS Win32Prn FROM WIN_PRN ENDCLASS