[SDK] build c++ console exe for 3dsmax of ExecuteMAXScriptScript cause error


I am trying to build a C++ console exe of ExecuteMAXScriptScript,when I run it,it causes error:

Exception code
0x0000000077408D84 (ntdll.dll) 0xC0000005,

Does any one know how to fix it?Thanks in advance.
The code is below:

#include "maxProject4.h"
#include <maxscript/maxscript.h>

int main()
	ExecuteMAXScriptScript(_T("print 123"));
	return 0;


you’ll need some serious hacker skills to get that shit to run… e,g, do you know what core max dll’s need to be loaded for that to work ?

it’s possible to create a console exe that can run mxs but it require OLE automation (you need to register max see mxs help) to work, that is Max runs as an OLE server and provides the function…

fn OLERunScript script = ( filein script; )

which is registered at max start up with…

registerOLEInterface #(OLERunScript)

you can then use microsoft COM Api from your console app to call the OLERunScript function


OK,thanks for help,I know the OLE,I just want console execute maxscript without OLE system.:worried:


what happens if you run it from the folder with the max exe in it ?




I guess the only robust approach is the gui one that used in project like this

Most likely I was talking about this one instead…