Crossware

Table of Contents        Previous topic       Next topic       

Using the Custom AppWizard or Project Template->Tutorial - Creating an Extension with the AppWizard->Configuring and Building the Extension

You cannot immediately compile the outline Virtual Workshop Extension that you have created.  If you try you will get an error message due to a trap that we have placed in one of the header files.

The reason for this is that the default debug version of the extension will use the a version of the Microsoft Foundation Classes that is different to the one that is being used by the Virtual Workshop.  Your extension will therefore be incompatible with it.

Therefore before you build your outline extension you need to modify the configuration setup for your Extension project.

Select Configurations.. from the Build menu of Microsoft Developer Studio.

Select Win32 Debug from the Project and Configurations tree.

Click on Remove to delete this debug configuration.  Click OK to confirm.

Click on Add to create a new project configuration.

The Copy settings from option should be Extension  Win32 Release since this the only remaining configuration.

In the Configuration edit box delete the word Release and enter My Debug.

Click on OK.

Click on Close.

You have now deleted the debug configuration created by AppWizard and created your own debug configuration which is identical to the release configuration created by AppWizard.  We will now modify your debug configuration so that it generates debug records and includes them in your extension.

Select Settings from the Project menu.

Select Win32  My Debug in the Settings For drop down list.

Click on the C/C++ tab.

Select Program Database in the Debug info drop down list.

Select Disable (Debug) in the Optimizations drop down list.

Click on the Link tab.

Click on the Generate debug info option to enable linker debug info.

Click on OK to close the Project Settings dialog box.

You can now build your extension with either of the two available configurations and they will both be compatible with the Virtual Workshop.

However the extension that you build will not be placed in the correct location or have the correct name to be automatically identified by the Virtual Workshop.  Therefore we need to make one more change that affects both configurations.

Select Settings again from the Project menu.

Select All Configurations in the Settings For drop down list.

Click on the Link tab.

Enter c:\estudio\projects\tutorial\bin\esim0.dll as the Output file name.

Click on OK.

You are now ready to build your outline extension.


Select Set Active Configuration from the Build menu.

Select the Extension  Win32 My Debug configuration.

Click on OK.

Select Rebuild All from the Build menu.

(Ignore warning LNK4070 generated by the Microsoft linker).

If you now look in directory c:\estudio\projects\tutorial\bin\ you will see your extension file: esim0.dll.

The version that you have created contains debug records and this is the one that you should use if you wish to single step through your extension.  Once your extension is developed you can build the Release configuration will run considerably faster than the one generated by you're My Debug version.

On final adjustment:

We want the Class Wizard to recognise CExtensionState class as a CCmdTarget.  To do this we need to delete the Class Wizard file that is created by default and force Class Wizard to create a new one.

From Explorer (or by some other means), delete file c:\estudio\Tutorial\Extension\Extension.clw.

From Microsoft Developer Studio, select ClassWizard from the View menu.  You will be told that the Class Wizard database does not exist.

Click Yes to build a new database from your source files.

Click on OK to use all of our source files to build the database.

Click on OK to close the MFC ClassWizard box.