FWH console (text-mode) application

FWH console (text-mode) application

Postby modicr » Fri Oct 16, 2009 11:55 pm

Hello!

I use FiveHCM.LIB from FWH 6.2 in my win32 console utility. Here is the link script:

/out:con_old.exe
/subsystem:console
con_old
rtl.lib
vm.lib
gtwin.lib
lang.lib
macro.lib
rdd.lib
ace32.lib
rddads.lib
dbfntx.lib
dbfcdx.lib
hbsix.lib
dbffpt.lib
debug.lib
common.lib
pp.lib
codepage.lib
C:\AAPL\C3\FWH.o9\LIB\FiveHCM.lib
c:\aapl\c3\vc\lib\kernel32.lib
c:\aapl\c3\vc\lib\user32.lib


Hera are the compiler options - Harbour is Alpha build 45.0 Intl. (Flex)

harbour con_old.prg /M /N /Q /W /A /V /B /P
cl.exe -TP -W3 -c /GA /FoCON_old.obj CON_old.c


And this is sample PRG:
Code: Select all  Expand view
#include "fivewin.ch"

***************
function main()
***************
* Test of FWH function AnsiToOem in win32 console application

QOUT( Version() )
QOUT( FWVERSION )
QOUT( '-------------------------------------------------------------' )
QOUT( 'Ansi:      ' + 'čšćđž ČŠĆĐŽ \|€[]@{}§<>÷פߣł' )
QOUT( 'AnsiToOem: ' + AnsiToOem('čšćđž ČŠĆĐŽ \|€[]@{}§<>÷פߣł') )
QOUT( '-------------------------------------------------------------' )
QOUT( '' )

return NIL  // main


Now I want to use FWH 9.01 and Harbour 1.0.1 but I have difficulties ... :(

First I renamed Harbour LIB-s and tried to compile/link, but I received the following errors:
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
con_new.obj : error LNK2001: unresolved external symbol _HB_FUN_FW_GT
hbrtl.lib(gtsys.obj) : error LNK2001: unresolved external symbol _HB_FUN_HB_GT_GUI


So I added /NODEFAULTLIB:LIBCMT and replaced GTWIN with GTGUI in link script:

/out:con_new.exe
/subsystem:console
/NODEFAULTLIB:LIBCMT
con_new
hbrtl.lib
hbvm.lib
gtgui.lib
xhb.lib
hblang.lib
hbmacro.lib
hbrdd.lib
hbct.lib
rddntx.lib
rddcdx.lib
hbsix.lib
rddfpt.lib
rddads.lib
ace32.lib
hbdebug.lib
hbcommon.lib
hbpp.lib
hbcpage.lib
c:\aapl\c3\fwh\lib\FiveHCM.lib
c:\aapl\c3\vc\lib\kernel32.lib
c:\aapl\c3\vc\lib\user32.lib


and added the following lines to PRG:
Code: Select all  Expand view
     REQUEST HB_GT_GUI_DEFAULT
      PROCEDURE HB_GTSYS() ; return
      procedure FW_GT ; return


Now the executable is generated without errors but unfortunately it does not work: When I start the EXE nothing happens! :cry:

Should I use another options for MS C Compiler - currently I use: cl.exe -TP -W3 -c /GA /FoCON_new.obj CON_new.c ? Any ideas?

Thanks, Roman
User avatar
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia

Re: FWH console (text-mode) application

Postby modicr » Sat Oct 17, 2009 12:14 pm

After some searching I solved it. :)

Here is the final PRG:

#include "fivewin.ch"
REQUEST HB_GT_WIN
REQUEST HB_GT_WIN_DEFAULT
ANNOUNCE FW_GT


***************
function main()
***************
* Test of FWH function AnsiToOem in win32 console application
QQOUT( OS() )
QOUT( Version() )
QOUT( HB_Compiler() )
QOUT( FWVERSION )
QOUT( 'Advantage Database Server '+AdsVersion() )
QOUT( '-------------------------------------------------------------' )
QOUT( 'Ansi:      ' + 'čšćđž ČŠĆĐŽ \|€[]@{}§<>÷פߣł' )
QOUT( 'AnsiToOem: ' + AnsiToOem('čšćđž ČŠĆĐŽ \|€[]@{}§<>÷פߣł') )
QOUT( '-------------------------------------------------------------' )
return NIL  // main


I also have now both gtwin.lib and gtgui.lib in the link script.

And here is the output : :D

Windows XP 5.1.2600 Service Pack 3
Harbour 1.0.1dev Intl. (Rev. 9361)
Microsoft Visual C 12.0 (32 bit)
FWH 9.01
Advantage Database Server 9.10
-------------------------------------------------------------
Ansi: čšćđž ČŠĆĐŽ \|€[]@{}§<>÷פߣł
AnsiToOem: źç†Đ§ ¬ćŹŃ¦ \|_[]@{}ő<>öžĎᝈ
-------------------------------------------------------------


Cheers, Roman
© I'm not patented!
User avatar
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia

Re: FWH console (text-mode) application

Postby Antonio Linares » Sat Oct 17, 2009 12:59 pm

Roman,

Please try it this way, and link gtwin.lib instead of gtgui.lib (modified inside samples\buildhm.bat):
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST HB_GT_WIN_DEFAULT

***************
function main()
***************
* Test of FWH function AnsiToOem in win32 console application

QOUT( Version() )
QOUT( FWVERSION )
QOUT( '-------------------------------------------------------------' )
QOUT( 'Ansi:      ' + 'cšcdž CŠCÐŽ \|€[]@{}§<>÷פßLl' )
QOUT( 'AnsiToOem: ' + AnsiToOem('cšcdž CŠCÐŽ \|€[]@{}§<>÷פßLl') )
QOUT( '-------------------------------------------------------------' )
QOUT( '' )

MsgInfo( "ok" )

return NIL  // main

procedure HB_GT_GUI_DEFAULT
return
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH console (text-mode) application

Postby modicr » Mon Oct 19, 2009 9:29 am

Antonio Linares wrote: and link gtwin.lib instead of gtgui.lib (modified inside samples\buildhm.bat):


Thanks for hints. When I link both GTGUI and GTWIN libraries, the solution, described in second message of this thread, works ...
But when I link only GTWIN, the following lines do the magic:

Code: Select all  Expand view
procedure FW_GT
return

REQUEST HB_GT_WIN_DEFAULT
ANNOUNCE HB_GT_GUI


Anyhow, with the help of this forum I was able to build new versions of our apps 3 days before the public launch of W7. :mrgreen:

Cheers, Roman

P.S. Search on this forum does not work when underscore is part of the word, for example try to search for FW_GT ...
© I'm not patented!
User avatar
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia

Re: FWH console (text-mode) application

Postby Antonio Linares » Mon Oct 19, 2009 10:47 am

Roman,

yes, we have noticed that bug of the search too.

We will try to find a solution for it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests