Image resource DLL creation instructions
Important: This page is mostly obsolete. It contains instructions for creating plugin resource DLLs by hand. This process is no longer required, but it is still available if required. This page is included only for reference; we discourage the use of resource dlls.
Generating resource DLLs
To manually add resource DLL projects, use MS Visual Studio to create an empty DLL for each supported platform, then for every image in the plugin project, add the appropriately-sized image to each resource DLL. Note that there are a number of difficulties with this method:
The resource.h file is present in each of the platform resource DLLs but not in the plugin project itself, where it is required in order to reference the resources. To allow the plugin to reference the resources, it must include one of the resource DLL project's resource.h files.
Every resource DLL must be kept exactly in step to avoid incorrect images being used.
Images must be added to every resource project.
Step by step
Previously to version 1.70 it was necessary to create plugin resource DLLs by hand. There are several steps to this; a wizard to simplify the process is available in version 1.80 and above. For a guide to doing this manually please go through the following steps. The screen snaps show the resources being created for the HowToSample plugin in the samples directory of the SCAPI SDK installation.
Create a resource DLL project to your plugin solution using the Add project wizard. Note the name which must be exactly your plugin name followed by one of the valid screen resolutions. The path should be the project directory of your plugin. The screenshots show the 320x240 resource project being created.
In the Application settings, choose DLL and empty project
Click Finish to create the project.
In project properties for All configurations, Linker Advanced settings, choose No Entry point = Yes. This prevents a "no entry point defined" error.
A resource.h file will have been added to the project by the previous step. Edit this file and adjust the next available resource value to a higher value to avoid any clashes with the plugin project. The default value is 101; the line below shows it changed to 5000:
#define _APS_NEXT_RESOURCE_VALUE 5000
If necessary, repeat the above steps 1-4 to make additional resource DLLs for other screen sizes you wish to support. If you are supporting just one screen size, only one resource DLL is required and all the following copying business may be ignored.
Now images can be added to the resource DLLs. We suggest that all the resource.h and Resources.rc files are kept in step by adding new images to just one of the projects (we'll call it the 'master' resource project; it can be any one of them), and then copying resource.h and Resources.rc to the other resource DLL projects prior to building them. In this way the resource projects will always remain in step. One way to automate the copy is to add a Pre-build event step into the 'master' resource project to perform the copy (note - to ensure a correct build order, make the other resource projects dependent on the 'master' project - and also set their project property Linker->General->Ignore import library to Yes to prevent LNK1181 errors).