Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/23/26 19:08
WFO Training with parallel cores Zorro64
by Martin_HH. 02/23/26 15:29
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (TipmyPip, tomaslolo, AndrewAMD, Martin_HH), 5,190 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Console Output? #345232
10/24/10 12:19
10/24/10 12:19
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
The functions to output to a console seem to be in windows.h, but I don't know where to start.

I want to have my dedicated server output information to a console, rather than initializing a directX window.

Has anyone ever output to a console from acknex?
Or are there any examples I could learn from?

I get errors just by calling AllocConsole(), but I can't find examples.


~"I never let school interfere with my education"~
-Mark Twain
Re: Console Output? [Re: Germanunkol] #345235
10/24/10 12:27
10/24/10 12:27
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Console Output? [Re: WretchedSid] #345237
10/24/10 12:44
10/24/10 12:44
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hi,
Yes, I have video_screen set to 0.
That works fine.

Also, I must correct the post above, the reason AllocConsole() was causing errors was that I didn't have all the right files included.

The problem ist that I don't know how to write to the console I create. There's the function
WriteConsole() in the windows.h, but it doesn't seem to be found? Or, how do I use it?
It says "undeclared identifier"... and in the windows.h I can find the APIA(WriteConsole) line, but no declaration of the function...?

Last edited by Germanunkol; 10/24/10 12:47.

~"I never let school interfere with my education"~
-Mark Twain
Re: Console Output? [Re: Germanunkol] #345238
10/24/10 12:48
10/24/10 12:48
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
just use printf()..

diag() also works if the app is started with "-diag"

EDIT: if you want to print on the 3dgs console that is.. don't know how to write the windows console..

Last edited by SchokoKeks; 10/24/10 12:50.
Re: Console Output? [Re: SchokoKeks] #345239
10/24/10 12:52
10/24/10 12:52
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
yes, also tried prinf but it writes to the acknex console. I wanna write to the console I created using AllocConsole...


~"I never let school interfere with my education"~
-Mark Twain
Re: Console Output? [Re: SchokoKeks] #345240
10/24/10 12:52
10/24/10 12:52
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Isn't stdout set to something weird on A7/A8? I can't imagine that it really flushes the content into the console but needs to reopened. But I might be wrong.


Edit: Okay, but shouldn't AllocConsole() give you a filestream to write into? You can reopen stdout at any time to write into the new console.

Last edited by JustSid; 10/24/10 12:53.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Console Output? [Re: WretchedSid] #345246
10/24/10 14:08
10/24/10 14:08
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
if you are using AllocConsole, you should use WriteConsole to write to that console.

Alternatively you can creata a console plugin, which imo would be neater and more easy to use.


3333333333
Re: Console Output? [Re: Quad] #345249
10/24/10 14:15
10/24/10 14:15
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Well, but how do I call WriteConsole?

AllocConsole() works fine, SetConsoleTitle() works, but when I call WriteConsole I get said error.

JustSid, AllocConsole doesn't return anything. Otherwise I could use the stream it gives me with fputs or fprint... but I don't know how to get the stream and then set it to use that stream.


~"I never let school interfere with my education"~
-Mark Twain
Re: Console Output? [Re: Germanunkol] #345259
10/24/10 15:12
10/24/10 15:12
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
you can add writeconsole to the windows.h, windows.h in gamestudio include folder is not complete.


3333333333
Re: Console Output? [Re: Germanunkol] #345260
10/24/10 15:20
10/24/10 15:20
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Here is what I found in the AllocConsole() description from the MSDN:
http://msdn.microsoft.com/en-us/library/ms683231(v=VS.85).aspx

Might be helpful to get the FILE handles.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 1 of 3 1 2 3

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

Gamestudio download | 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