2001-08-23 23:13 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

* 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
This commit is contained in:
Maurilio Longo
2001-08-23 21:16:46 +00:00
parent 4246c611e7
commit aead08fae9
3 changed files with 37 additions and 6 deletions

View File

@@ -1,3 +1,14 @@
2001-08-23 23:13 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* 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 <maurilio.longo@libero.it>
+ source/vm/mainpm.c
+ added mainpm.c entry point for OS/2 Presentation Manager applications

View File

@@ -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=\

View File

@@ -6,7 +6,7 @@
* Harbour Project source code:
* OS/2 Presentation Manager application entry point
*
* Copyright 2001 Harbour Project
* Copyright 2001 Maurilio Longo <maurilio.longo@libero.it>
* 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 <os2.h>
#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 ) );
}