Using Visual Studio
This SDK supports Visual Studio 2015 or later. The screen shots are almost from old version of Visual Studio, but most of the operations are the same for 2015 and later versions, and operations for each version are described only when they differ.
- Open mqsdk.sln by Visual Studio.
When you open the solution file with Visual Studio 2017 or later, it is demanded whether to convert the project
in a dialog. Please convert it and open.
- Download WTL (Windows Template Library), expand the file and
add the include directory in [Configuration Properties > VC++ Directories > Include Directories] in each project property for building a sample project using WTL
like as StationSpy. The WTL version 7.5 has been confirmed for a build.
Currently, original widgets are recommended to create GUI like as a dialog. This setting is unnecessary if you do not want to build a sample project with WTL.
Set in [Configuration Properties > VC++ Directories] of the project property pages.

- Call the menu: File > Add > New project.
- Select [Visual C++ > Win32] from installed templates, select [Win32 Project], and input a project name.

- Select [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.

- Existing projects have settings for both 32-bit and 64-bit. But, the created project initially has a setting for 32-bit only.
Open [Build > Configuration Manager], select [x64] in [Active Solution Platform], and select [New] in the [Platform] for the created project. Push [OK] in the dialog, and a setting for 64-bit will be created.

- For both [Debug] and [Release] in the [Active solution configuration], select [x64] as [Platform] and check [Build] on and close the dialog.

- 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.
- Select [All Configurations] as Configuration and [All Platforms] as Platform in the project property pages, and input the following string in the [Output Directory] and [Intermediate Directory]:
$(Platform)\$(Configuration)\
Built files will be outputted in the Win32/x64 and Debug/Release directory under the project.

- 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.

- 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().
- Change the Solution Platform to [Win32] or [x64] and the Solution Configuration to [Debug] or [Release] if necessary. And build the project. And the plug-in
will be completed.

If some resource files (.rc files) are failed to compile, the following code in each .rc file must be commented
out:
, 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.
