Creating a MaxImDL Plugin using Visual C++

This is a tutorial for how to create a new project in Visual C++ for the basic framework of a MaxImDL plugin.

1) Start a new project from scratch in Visual C++. Select ATL COM AppWizard and specify your project name and location, and hit OK.

 

2) Set the options as shown below, hit Finish, then hit OK when the informational dialog appears:

 

3) From the FileView open the .idl file for your project.  You need to delete the "Lib" that VC++ has appended to the library name as shown below.

 

You also need to delete the "Lib" from the name in the .cpp file created for your project.  If you named your project "TakeImage", you will need to edit the file "TakeImage.cpp".  Look for the section similar to what's shown below for the name that needs to be edited:

 

4) Select the ClassView tab and hit Control-W.  The ClassWizard should be displayed as shown below:

 

5) Click on Add Class and select "From a type library":

 

6) Navigate to the directory where MaxImDL is installed and change the Files of type box to "All Files (*.*)":

 

7) Find the MaxIm_DL.exe file, highlight it and click Open.  Select OK when the Confirm Classes dialog appears.

Then you can cancel out of the MFC ClassWizard dialog.

 

8) From the ClassView tab again, right click on the top entry for your projects classes and select "New Class":

 

9) From the New Class dialog, make sure the class type is set to "ATL Class" and name your class something like "CPlugin" as shown below, then select OK:

 

10) From the ClassView tab again, right click on the interface to your plugin and select "Add Method":

Note:  The interface name was assigned when you added the new class as shown in the previous step above.

 

11) Fill in the Method Name and Parameters as shown below then hit OK:

 

12) From the ClassView tab again, right click on the interface to your plugin and select "Add Property":

 

13) Select "BSTR" for Property Type, type "Name" into the Property Name field, uncheck the Put Function option, and hit OK:

 

14) From the FileView tab, open the .cpp file for the class you created and add the lines shown below to your "get_Name" method.  If you named your class "CPlugin" then the file you need to edit is "Plugin.cpp".

 

 

You are now ready to add your own custom code to the DoModal() method.

 

I recommend creating a "Plugins" subdirectory below the MaxImDL installation where you can locate all your plugin .dll files.

 

To use your plugin in MaxImDL:

    1) Run MaxImDL.

    2) Select Plug-in then Add/Remove Plug-in.

    3) Click the Browse button and navigate to where your plugin's .dll file is located.

    4) Select your plugin file.

    5) Close the Add/Remove Plug-in dialog.

    6) Your plugin should now be available from the Plug-in menu in MaxImDL.