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


#1

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<Windows.h>
#include <maxscript/maxscript.h>

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

#2

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


#3

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


#4

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


#5

Freezed,crashed.


#6

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

upd
Most likely I was talking about this one instead…


#7

Who could have thought it is actually possible :grimacing:
Max.NET: External scripting via .NET remoting

other tuts videos:
https://ephere.com/autodesk/max/