. Home Feedback Contents Search

Resource Only DLL Creation 

Back Up Next

In this example case, we wish to create a new DLL that will handle the resources for ConfigSOMHome project. By convention, the resource project will exist under ConfigSOMHome and the name will be generated by taking the base name and appending a Res to it. Thus, we will name the new project ConfigSOMHomeRes.

 

DLL Type

What type of DLL should we choose?

There are three types of DLLs

  • Regular
  • Regular that uses MFC
  • MFC extension DLL.

If the owning process is a non-MFC process then the DLL can be either a regular DLL or a DLL that uses MFC. On the other hand, if the owning process is MFC compliant then an MFC extension DLL can be used.

The primary advantage of an MFC extension is that it automatically hooks itself into the resource tree of its encapsulating process. This only works if the process itself is MFC compliant which, in this case, is true. However, this is an advantage which we can not take make use of given that the under lying localizing code is going to explicitly load the resources as circumstances dictate. The majority of resource pages already created ignored this little aspect of reality and went ahead and used an MFC extension DLL so we will, too.

Clicking on the Finish button brings up a final status dialog. Click its OK button and the new project will be created.

This creates the new project and populates it with the default code. If your Dev Studio settings are not set to automatically prompt you for permission to add newly created projects to Perforce, you will have to do this manually.

Removing Default RC and Resource.H From the Project

If your settings resulted in the automatic addition of the new code into your source code management system then there is an extra step you are going to have to go through. Select the RC and Resource.h files, right click and select Undo Check Out….

With just the RC and Resource.h file selected, hit the Delete key. This will remove the two files from the project. Depending upon your particular source code management system, it may or may not also remove the new files from source code management. If they haven't already gone the way of the Great Bit Bucket in the Sky, nuke them at your earliest opportunity.

This will result in the removal of the unwanted files.

Delete Default RC and Resource.H

The default RC and its associated Resource.h file are in the way. Manually delete them.

Add To Source Control

If Dev Studio didn’t automatically ask you to add the project to the code repository, you will need to do that now. Select all of the files, right click and select Add to Source Control….

This starts the addition of new source process.

You don’t have to add a comment but it doesn’t hurt. It isn’t until the first time you check things in and leave them checked it that you will need to supply a comment.

Make sure that Keep checked out is checked so we can play with it as we will.

Add Base RC and Resource.H

The project exists but it doesn’t do anything. It doesn’t have any resources. It is time to fix that by telling the project to include its parent’s RC file. In the example’s case, we want the project to include ConfigSOMAuthenticaiont’s RC file.

 

 Select both the RC and the Resource.h

 

 This will bind the base RC and Resource.h to the localization resource only satellite DLL.

Back Up Next

Hit Counter