Download WTL (Windows Template Library), expand the file and include the
path in the menu Tool > Options for building a sample project using WTL. The WTL version 7.5 has been confirmed for a build.
Open mqsdk.sln by Visual Studio 2008. When you open the solution file, it is demanded whether to convert the project
in Visual Studio Conversion Wizard. Please convert it and open.
Call the menu: File > Add > New project.
Select "Visual C++ > Win32" for a project type, select "Win32 Project" for a template, and input a project name.
Select not "Finish" but "Next " button in the Win32 Application Wizard.
Check "DLL" for an application type and "Empty project" for additional options, and push the "Finish" button.
And a new project will be created under the mqsdk directory.
Copy a .cpp file in a plug-in which the type of the plug-in is same as you want to create (for example, Spring.cpp
for "Create" plug-in), rename it and save.
Add the saved .cpp file and MQInit.cpp to the project.
Edit the .cpp file to create your own program. At the time, it is necessary for modifying plug-in functions like as MQGetPlugInID()
and MQGetPlugInName().
Open "Property" of the project, select "Configuration Properties > C/C++ > General", and add ".." directory to the "Additional
Include Directories". And you can compile normally without copying MQPlugin.h in the mqsdk directory.
Select "Configuration Properties > General", and specify "Use Multi-Byte Character Set" for the
"Character Set". When you use Unicode character set, the source code contained in the SDK will be not compile
normally.
Change the Solution Configuration to "Debug" or "Release" if necessary, and build the project. And the plug-in
will be completed.
When you build projects using WTL (Windows Template Library) by Visual C++ 2008 Express Edition, the error message
"fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory" will be shown and fail to
compile. I hear WDK (Windows Driver Kit) contains 'atlbase.h'. Please check details on the Web.
Some resource files (.rc files) are failed to compile with Visual C++ 2008
Express Edition. The following code in each .rc file must be commented
out:
#include "afxres.h"
, and replace to the following:
#include <windows.h>
#define IDC_STATIC -1
Choose Metaseq.exe in "Configuration Properties >
Debugging > Command" when you build a project for a "Debug" build. And you can debug the created plug-in .dll file.