• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# To those who know about 3DSMAX's plugins

## Recommended Posts

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

##### Share on other sites
NickB    146
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

##### Share on other sites
Myopic Rhino    2315
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?

##### Share on other sites
Void    126
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.

##### Share on other sites
It was the extern "C", thanks a lot!!!

##### Share on other sites
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?