Notifications
Clear all

[Closed] Console logging for a max plugin

I wonder if anyone here has tried debugging a plugin by printing info in the windows console, maybe the node name, hierarchy, etc. I tried this using the simple standard C++ ostream (cout), but i can’t even make the console open. My plugin sets the Linker->System->Subsystem->Console (/SUBSYSTEM:CONSOLE) option but when the debugger starts, is hidden anyway.
Do I have to manually create the console in the plug-in initialization or is there an easier way of doing this?

8 Replies

You can print to the output window in visualstudio.

see here:

http://www.windows-tech.info/18/5bc1830de822b81d.php

1 Reply
(@pjanssen)
Joined: 11 months ago

Posts: 0

The SDK also provides a function “DebugPrint” allowing easy string formatting, which is nice.

you also can print to maxscript listener with mprintf()
if it help you

3 Replies
(@stigatle)
Joined: 11 months ago

Posts: 0

Thanks for this tip, I honestly did not know that, this is very useful!

(@duke)
Joined: 11 months ago

Posts: 0

What do I have to include to use that? It doesn’t know what it is from a new wizard generated modifier.

(@dokdan85)
Joined: 11 months ago

Posts: 0

try
#include “maxscrpt.h”
or
#include “maxscrpt\maxscrpt.h”

Thank you guys, indeed all of those were useful, although a bit restrictive. The thing is I already have a dll logger which works in a windows console and i use for other enviroemnts, it will be perfect if I can redirect my logging printing of this max plugin to that dll, with those options you mention it will be tricky but let me try…

try to include:

#include <stdio.h>