From aead08fae99c5fa7e66869554040636edb003146 Mon Sep 17 00:00:00 2001 From: Maurilio Longo Date: Thu, 23 Aug 2001 21:16:46 +0000 Subject: [PATCH] 2001-08-23 23:13 GMT+2 Maurilio Longo * source/vm/Makefile + if HB_GT_LIB == os2pm then compiles mainpm.c instead of main.c * source/vm/mainpm.c * little changes to make it work. NOTE: after gcc creates an executable file you need to issue an: emxbind -ep filename.exe to mark it as a PM executable, failing to do so the executable file is a VIO one and all calls to WinXxx() functions will fail --- harbour/ChangeLog | 11 +++++++++++ harbour/source/vm/Makefile | 6 +++++- harbour/source/vm/mainpm.c | 26 +++++++++++++++++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 796070b3c3..7135f545a3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,14 @@ +2001-08-23 23:13 GMT+2 Maurilio Longo + * source/vm/Makefile + + if HB_GT_LIB == os2pm then compiles mainpm.c instead of main.c + * source/vm/mainpm.c + * little changes to make it work. + + NOTE: after gcc creates an executable file you need to issue an: + emxbind -ep filename.exe + to mark it as a PM executable, failing to do so the executable file is a + VIO one and all calls to WinXxx() functions will fail + 2001-08-23 16:43 GMT+2 Maurilio Longo + source/vm/mainpm.c + added mainpm.c entry point for OS/2 Presentation Manager applications diff --git a/harbour/source/vm/Makefile b/harbour/source/vm/Makefile index bfe121aeba..86f3f07eee 100644 --- a/harbour/source/vm/Makefile +++ b/harbour/source/vm/Makefile @@ -7,7 +7,11 @@ ROOT = ../../ ifeq ($(HB_ARCHITECTURE),w32) C_MAIN := mainstd.c mainwin.c else - C_MAIN := main.c + ifeq ($(HB_GT_LIB),os2pm) + C_MAIN := mainpm.c + else + C_MAIN := main.c + endif endif C_SOURCES=\ diff --git a/harbour/source/vm/mainpm.c b/harbour/source/vm/mainpm.c index 656e88b8a6..cd427707df 100644 --- a/harbour/source/vm/mainpm.c +++ b/harbour/source/vm/mainpm.c @@ -6,7 +6,7 @@ * Harbour Project source code: * OS/2 Presentation Manager application entry point * - * Copyright 2001 Harbour Project + * Copyright 2001 Maurilio Longo * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -51,13 +51,14 @@ */ - +#define INCL_BASE #define INCL_PM #include #include "hbapi.h" +#include "hbvm.h" -static HAB hab; /* Anchor Table handle */ +static HAB hab; /* Anchor Block handle */ static HMQ hmq; /* Message Queue handle */ int main( int argc, char * argv[] ) @@ -77,12 +78,27 @@ int main( int argc, char * argv[] ) } -HAB GetHab( void ) { +/* NOTE: We don't need to have global HAB and HMQ */ +HAB hb_pm_GetHab( void ) { return hab; } HB_FUNC( GETHAB ) { - hb_retnl( ( LONG ) GetHab() ); + hb_retnl( ( LONG ) hb_pm_GetHab() ); } + + +/* NOTE: Just a test, to remove */ +HB_FUNC( MSGINFO ) +{ + HWND hWnd = WinQueryActiveWindow( HWND_DESKTOP); + PSZ szCaption = ( hb_pcount() > 1 && ISCHAR( 2 ) ? hb_parc( 2 ) : "Information"); + + hb_retnl( WinMessageBox( HWND_DESKTOP, hWnd, hb_parc( 1 ), szCaption, + 0, MB_INFORMATION | MB_OK | MB_MOVEABLE | MB_APPLMODAL ) ); +} + + +