To those who know about 3DSMAX's plugins

Started by
5 comments, last by Alload 22 years, 2 months ago
I wrote the beginning of a scene exporter plugin for 3D Studio MAX 4. Then I have put the plugin in the plugins folder of MAX and I launched MAX. And there''s an error while MAX loads my plug: "The LibVersion function is not implemented." However there''s the LibVersion() in my code: __declspec(dllexport) ULONG LibVersion() { return VERSION_3DSMAX; } And the def file looks good: LIBRARY MAX Plugin EXPORTS LibDescription @1 LibNumberClasses @2 LibClassDesc @3 LibVersion @4 SECTIONS .data READ WRITE So if anyone could help me to get it working. Thanks
Advertisement
First, I''m sorry in so much as I don''t have max...

but I think I can guess what your problem is

Basically I looks like you want to export a C style name & I guess you''re doing it from a C++ compiler

The thing is that the C++ compiler mangles the function names, the way to get around this is to have an extern "C" prototype for the function in the header file, ie

  extern "C" __declspec(dllexport) ULONG LibVersion(void);  


(or if you''re not using a header for the project just put it at the top of the source file
Actually, what you''re doing looks right. I unfortunately don''t even have a guess about why it''s not working.

Is this an AppWizard generated plugin?
The only thing I can think of is the calling convention. Did you change the default CC to somthing other than cdecl?

Otherwise, it looks exactly like how I have done it.
It was the extern "C", thanks a lot!!!
Another problem.

As a scene exporter based on the SceneExport class, my plugin should be available in the EXPORT menu, shouldn''t it?

But it does not appear in it...

I dunno where the error comes from, because MAX loads my plugin without any error message.

Is there anything special which has to be done to make the plugin appear in the EXPORT menu?
I assume you rememebered to do extern "C" on all the functions that need to be exported...

Otherwise you''ll just have to go back to the docs & examples...

Stick some messageboxes or debug messages that somehow flash up at points through your plugin...

This topic is closed to new replies.

Advertisement