|
|
Console Output?
#345232
10/24/10 12:19
10/24/10 12:19
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
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: WretchedSid]
#345237
10/24/10 12:44
10/24/10 12:44
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
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
SchokoKeks
User
|
User
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
OP
Expert
|
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
Expert
|
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
Senior Expert
|
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
OP
Expert
|
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
Senior Expert
|
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
|
|
|
|