Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Acknex.exe with console [Re: Tempelbauer] #377002
07/08/11 22:03
07/08/11 22:03
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Thats a great contribution,
would you mind sharing the changes you did to acknex.cpp to make it open a second window that displays the console?
that would probably save me a lot of hassle laugh

Re: Acknex.exe with console [Re: SchokoKeks] #377004
07/08/11 22:27
07/08/11 22:27
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline OP
Senior Expert
Quad  Offline OP
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
There is no change in the source, only on project settings. Set it as console application instead of windows application and you are set.


3333333333
Re: Acknex.exe with console [Re: Quad] #379454
08/02/11 20:35
08/02/11 20:35
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
mh if publishing doesnt work with this technique, maybe create a second application, a logger application which can communicate through pipes with liteC? since we have winapi, we have pipes. Worked with them at work in delphi. It might be a bit complicated at first but allows them to use for logging(tools like smartinspect for example use them).

This way you can send messages between applications.

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Acknex.exe with console [Re: Rackscha] #451432
05/06/15 11:08
05/06/15 11:08
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Sooo.. is this still around somewhere?


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Acknex.exe with console [Re: alibaba] #451433
05/06/15 12:23
05/06/15 12:23
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Call AllocConsole and there it is.
You can google the API, it will be described further on msdn.

Re: Acknex.exe with console [Re: Ch40zzC0d3r] #451434
05/06/15 12:37
05/06/15 12:37
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Sadly it won´t display any printf calls whatsoever. Is there a way to use the console to command the acknex engine? I need this to modify a dedicaded server in runtime.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Acknex.exe with console [Re: alibaba] #451435
05/06/15 12:54
05/06/15 12:54
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
if you have the console, try reading the stdin file via fread wink


Visit my site: www.masterq32.de
Re: Acknex.exe with console [Re: alibaba] #451437
05/06/15 12:58
05/06/15 12:58
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
You will love this!

You can redirect stdout to a virtual console file using freopen() like so:
Code:
freopen("CONOUT$", "w", stdout);



Redirecting the console to stdin works via the CONIN$ virtual file.

This, of course, does not work with the standard Gamestudio printf(), because standard gamestudio is stupid and doesn't actually ever output to stdout. So, here is the amazing workaround: Shadow printf so that it actually fprintf() with stdout as argument! Cool, but, Lite-C does not support variadic macros and one of the great things about printf() is that you can put a format string in there and you probably do that and don't want to change your call sites. If you expect some genius solution now, sorry, you are totally out of luck. Here is how to write the basic macro though:

Code:
#define elide_arg (0)
#define pack_args1(arg0) arg0
#define pack_args2(arg0, arg1) arg0, arg1
#define pack_args3(arg0, arg1, arg2) arg0, arg1, arg2

#define printf(format, args) fprintf(stdout, format, args)



And your call sites would need to change like this:

Code:
// Old
printf("Hello World");
printf("Hello %s, %d", "world", 42);

// New
printf("Hello World", elide_arg);
printf("Hello %s, %d", pack_args2("world", 42));



PS: For Chaos, who prefers Haskell over Lite-C, the way to go is using the Text.Printf packaged. Printf has the following signature: printf :: PrintfType r => String -> r


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Acknex.exe with console [Re: WretchedSid] #451446
05/06/15 15:29
05/06/15 15:29
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Thanks for your answers! I read into the topic a bit now.

@Sid
Thank you very much! Unfortunately it seems like Acknex does not support fprintf. It´s also not declared in the windows.h. Or am I on the completely wrong way now?


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Acknex.exe with console [Re: alibaba] #451448
05/06/15 15:34
05/06/15 15:34
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
You can just try to declare the prototype of the function without loading it. Should work as the Lite-C compiler links against the default c runtimes where fprintf is included wink


Visit my site: www.masterq32.de
Page 2 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1