FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Can't allocate console
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Can't allocate console
Posted: Thu Jan 17, 2013 03:55 PM
I'm trying to test in my win7 notebook a CGI
Hello.exe CGI
This is source code
Code (fw): Select all Collapse
#include "Simpleio.ch"

FUNCTION MAIN()

  ?? [Content-type: text/html]
  ?
  ? [<HTML>]
  ? [<BODY>]
  ? [<HEAD>]
  ? [ Hello world ]
  ? [</HEAD>]
  ? [</BODY>]
  ? [</HTML>]
RETURN NIL


I digit
http://127.0.0.1/hello.exe
in my browser
I wait for a long and then I fine in c:\inetpub\wwwroot (the same folder of hello.exe
an error.log containing this phrase
Can't allocate console
:-)
Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Can't allocate console
Posted: Thu Jan 17, 2013 04:44 PM

In XP instead it works fine

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
SOLVED: Re: Can't allocate console
Posted: Thu Jan 17, 2013 05:08 PM
The problem is solved in this way:

Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "Report.ch"

#xcommand ? <x> => ConOut( <x> )

FUNCTION MAIN()

   ContentType()

  ?
  ? [<HTML>]
  ? [<BODY>]
  ? [<HEAD>]
  ? [ Hello World ]
  ? [ <A HREF = "http://172.28.2.189/new/disegno.bmp"> Disegno </A> ]
  ? [</HEAD>]
  ? [</BODY>]
  ? [</HTML>]


    RETURN NIL


#pragma BEGINDUMP

#include <hbapi.h>

HB_FUNC( CONTENTTYPE )
{
   printf( "Content-Type: text/html\n\n" );
}

HB_FUNC( CONOUT )
{
   printf( "%s\n", ( char * ) hb_parc( 1 ) );
}

#pragma ENDDUMP


The new question is This CGI works everywhere?
Or works fine in this scenario?
Tomorrow the solution
Bye for now
marco
Marco Boschi
info@marcoboschi.it

Continue the discussion