Refactored MTConnector with new architecure

This commit is contained in:
Viacheslav Demydiuk
2024-06-16 13:30:24 +03:00
parent 07b26a6ac1
commit 46a5ca4d04
6 changed files with 83 additions and 303 deletions
-40
View File
@@ -1,40 +0,0 @@
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("MTConnector")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("DW")];
[assembly:AssemblyProductAttribute("MTConnector")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) DW 2011")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
+13 -7
View File
@@ -3,22 +3,28 @@
#pragma once #pragma once
#include <Windows.h> #include <Windows.h>
#include <MetaTraderHandler.h>
using namespace MTApiService; class MT4Handler: public MetaTraderHandler
ref class MT4Handler: IMetaTraderHandler
{ {
public: public:
MT4Handler() MT4Handler(int handle)
: handle_(handle)
{ {
msgId = WM_TIMER; msg_id_ = WM_TIMER;
} }
virtual void SendTickToMetaTrader(int handle) virtual void SendTickToMetaTrader(int handle)
{ {
PostMessage((HWND)handle, msgId, 0, 0); PostMessage((HWND)handle, msg_id_, 0, 0);
} }
private: private:
unsigned int msgId; void SendTickToMetaTrader() override
{
PostMessage((HWND)handle_, msg_id_, 0, 0);
}
int handle_;
unsigned int msg_id_;
}; };
+44 -221
View File
@@ -1,30 +1,28 @@
// This is the main DLL file. // This is the main DLL file.
#include "stdafx.h" #include "Stdafx.h"
#include "MT4Handler.h" #include "MT4Handler.h"
#include "MtService.h"
#include "Windows.h" #include "Windows.h"
#include <vcclr.h>
#include <functional> #include <functional>
#include <string>
#include <codecvt>
using namespace System; static void convertSystemString(wchar_t* dest, const std::string& src)
using namespace MTApiService;
using namespace System::Runtime::InteropServices;
using namespace System::Reflection;
using namespace System::Security::Cryptography;
using namespace System::Security;
using namespace System::Text;
using namespace System::IO;
using namespace System::Collections::Generic;
using namespace System::Diagnostics;
#define _DLLAPI extern "C" __declspec(dllexport)
void convertSystemString(wchar_t* dest, String^ src)
{ {
pin_ptr<const wchar_t> wch = PtrToStringChars(src); using convert_typeX = std::codecvt_utf8<wchar_t>;
memcpy(dest, wch, wcslen(wch) * sizeof(wchar_t)); std::wstring_convert<convert_typeX, wchar_t> converterX;
dest[wcslen(wch)] = '\0'; auto wstr = converterX.from_bytes(src);
memcpy(dest, wstr.c_str(), wcsnlen(wstr.c_str(), 1000) * sizeof(wchar_t));
}
static std::string convertWString(const wchar_t* src)
{
std::wstring string_to_convert(src);
using convert_typeX = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_typeX, wchar_t> converterX;
return converterX.to_bytes(string_to_convert);
} }
template <typename T> T Execute(std::function<T()> func, wchar_t* err, T default_value) template <typename T> T Execute(std::function<T()> func, wchar_t* err, T default_value)
@@ -34,19 +32,19 @@ template <typename T> T Execute(std::function<T()> func, wchar_t* err, T default
{ {
result = func(); result = func();
} }
catch (Exception^ e) catch (std::exception& e)
{ {
convertSystemString(err, e->Message); convertSystemString(err, e.what());
MtAdapter::GetInstance()->LogError(e->Message); MtService::GetInstance().LogError(e.what());
} }
return result; return result;
} }
_DLLAPI bool _stdcall initExpert(int expertHandle, int port, wchar_t* symbol, double bid, double ask, wchar_t* err) _DLLAPI bool _stdcall initExpert(int expertHandle, int port, wchar_t* err)
{ {
return Execute<bool>([&expertHandle, &port, symbol, &bid, &ask]() { return Execute<bool>([&expertHandle, &port]() {
auto expert = gcnew MtExpert(expertHandle, gcnew String(symbol), bid, ask, gcnew MT4Handler()); auto mt_handler = std::make_unique<MT4Handler>(expertHandle);
MtAdapter::GetInstance()->AddExpert(port, expert); MtService::GetInstance().InitExpert(port, expertHandle, std::move(mt_handler));
return true; return true;
}, err, false); }, err, false);
} }
@@ -54,214 +52,39 @@ _DLLAPI bool _stdcall initExpert(int expertHandle, int port, wchar_t* symbol, do
_DLLAPI bool _stdcall deinitExpert(int expertHandle, wchar_t* err) _DLLAPI bool _stdcall deinitExpert(int expertHandle, wchar_t* err)
{ {
return Execute<bool>([&expertHandle]() { return Execute<bool>([&expertHandle]() {
MtAdapter::GetInstance()->RemoveExpert(expertHandle); MtService::GetInstance().DeinitExpert(expertHandle);
return true; return true;
}, err, false); }, err, false);
} }
_DLLAPI bool _stdcall updateQuote(int expertHandle, wchar_t* symbol, double bid, double ask, wchar_t* err) _DLLAPI bool _stdcall sendEvent(int expertHandle, int event_type, const wchar_t* payload, wchar_t* err)
{ {
return Execute<bool>([&expertHandle, symbol, &bid, &ask]() { return Execute<bool>([&expertHandle, &event_type, payload]() {
MtAdapter::GetInstance()->SendQuote(expertHandle, gcnew String(symbol), bid, ask); MtService::GetInstance().SendEvent(expertHandle, event_type, convertWString(payload));
return true; return true;
}, err, false); }, err, false);
} }
_DLLAPI int _stdcall sendResponse(int expertHandle, const wchar_t* response, wchar_t* err)
_DLLAPI bool _stdcall sendEvent(int expertHandle, int eventType, wchar_t* payload, wchar_t* err)
{ {
return Execute<bool>([&expertHandle, &eventType, payload]() { return Execute<int>([&expertHandle, response]() {
MtAdapter::GetInstance()->SendEvent(expertHandle, eventType, gcnew String(payload)); MtService::GetInstance().SendResponse(expertHandle, convertWString(response));
return true; return 1;
}, err, false); }, err, 0);
} }
_DLLAPI bool _stdcall sendIntResponse(int expertHandle, int response, wchar_t* err) _DLLAPI int _stdcall getCommandType(int expertHandle, int& res, wchar_t* err)
{ {
return Execute<bool>([&expertHandle, &response]() { return Execute<int>([&expertHandle, &res]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseInt(response)); res = MtService::GetInstance().GetCommandType(expertHandle);
return true; return 1;
}, err, false); }, err, 0);
} }
_DLLAPI bool _stdcall sendBooleanResponse(int expertHandle, bool response, wchar_t* err) _DLLAPI int _stdcall getPayload(int expertHandle, wchar_t* res, wchar_t* err)
{ {
return Execute<bool>([&expertHandle, &response]() { return Execute<int>([&expertHandle, res]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseBool(response)); convertSystemString(res, MtService::GetInstance().GetCommandPayload(expertHandle));
return true; return 1;
}, err, false); }, err, 0);
}
_DLLAPI bool _stdcall sendDoubleResponse(int expertHandle, double response, wchar_t* err)
{
return Execute<bool>([&expertHandle, &response]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseDouble(response));
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendStringResponse(int expertHandle, wchar_t* response, wchar_t* err)
{
return Execute<bool>([&expertHandle, response]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseString(gcnew String(response)));
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendErrorResponse(int expertHandle, int code, wchar_t* message, wchar_t* err)
{
return Execute<bool>([&expertHandle, &code, message]() {
MtResponseString^ res = gcnew MtResponseString(gcnew String(message));
res->ErrorCode = code;
MtAdapter::GetInstance()->SendResponse(expertHandle, res);
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendVoidResponse(int expertHandle, wchar_t* err)
{
return Execute<bool>([&expertHandle]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseObject(nullptr));
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendDoubleArrayResponse(int expertHandle, double* values, int size, wchar_t* err)
{
return Execute<bool>([&expertHandle, values, &size]() {
array<double>^ list = gcnew array<double>(size);
for (int i = 0; i < size; i++)
{
list[i] = values[i];
}
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseDoubleArray(list));
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendIntArrayResponse(int expertHandle, int* values, int size, wchar_t* err)
{
return Execute<bool>([&expertHandle, values, &size]() {
array<int>^ list = gcnew array<int>(size);
for (int i = 0; i < size; i++)
{
list[i] = values[i];
}
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseIntArray(list));
return true;
}, err, false);
}
_DLLAPI bool _stdcall sendLongResponse(int expertHandle, __int64 response, wchar_t* err)
{
return Execute<bool>([&expertHandle, &response]() {
MtAdapter::GetInstance()->SendResponse(expertHandle, gcnew MtResponseLong(response));
return true;
}, err, false);
}
_DLLAPI bool _stdcall getCommandType(int expertHandle, int* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, res]() {
*res = MtAdapter::GetInstance()->GetCommandType(expertHandle);
return true;
}, err, false);
}
// --- index parameters
_DLLAPI bool _stdcall getIntValue(int expertHandle, int paramIndex, int* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, &paramIndex, res]() {
*res = MtAdapter::GetInstance()->GetCommandParameter<int>(expertHandle, paramIndex);
return true;
}, err, false);
}
_DLLAPI bool _stdcall getDoubleValue(int expertHandle, int paramIndex, double* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, &paramIndex, res]() {
*res = MtAdapter::GetInstance()->GetCommandParameter<double>(expertHandle, paramIndex);
return true;
}, err, false);
}
_DLLAPI bool _stdcall getStringValue(int expertHandle, int paramIndex, wchar_t* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, &paramIndex, res]() {
convertSystemString(res, MtAdapter::GetInstance()->GetCommandParameter<String^>(expertHandle, paramIndex));
return true;
}, err, false);
}
_DLLAPI bool _stdcall getBooleanValue(int expertHandle, int paramIndex, int* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, &paramIndex, res]() {
*res = MtAdapter::GetInstance()->GetCommandParameter<bool>(expertHandle, paramIndex);
return true;
}, err, false);
}
_DLLAPI bool _stdcall getLongValue(int expertHandle, int paramIndex, __int64* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, &paramIndex, res]() {
*res = MtAdapter::GetInstance()->GetCommandParameter<__int64>(expertHandle, paramIndex);
return true;
}, err, false);
}
// --- named parameters
_DLLAPI bool _stdcall containsNamedValue(int expertHandle, wchar_t* paramName)
{
wchar_t err[1000];
return Execute<bool>([&expertHandle, paramName]() {
return MtAdapter::GetInstance()->ContainsNamedParameter(expertHandle, gcnew String(paramName));
}, err, false);
}
_DLLAPI bool _stdcall getNamedIntValue(int expertHandle, wchar_t* paramName, int* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, paramName, res]() {
System::Object^ obj = MtAdapter::GetInstance()->GetNamedParameter(expertHandle, gcnew String(paramName));
*res = (int)obj;
return true;
}, err, false);
}
_DLLAPI bool _stdcall getNamedDoubleValue(int expertHandle, wchar_t* paramName, double* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, paramName, res]() {
System::Object^ obj = MtAdapter::GetInstance()->GetNamedParameter(expertHandle, gcnew String(paramName));
*res = (double)obj;
return true;
}, err, false);
}
_DLLAPI bool _stdcall getNamedStringValue(int expertHandle, wchar_t* paramName, wchar_t* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, paramName, res]() {
System::Object^ obj = MtAdapter::GetInstance()->GetNamedParameter(expertHandle, gcnew String(paramName));
convertSystemString(res, (String^)obj);
return true;
}, err, false);
}
_DLLAPI bool _stdcall getNamedBooleanValue(int expertHandle, wchar_t* paramName, int* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, paramName, res]() {
System::Object^ obj = MtAdapter::GetInstance()->GetNamedParameter(expertHandle, gcnew String(paramName));
*res = (bool)obj;
return true;
}, err, false);
}
_DLLAPI bool _stdcall getNamedLongValue(int expertHandle, wchar_t* paramName, __int64* res, wchar_t* err)
{
return Execute<bool>([&expertHandle, paramName, res]() {
System::Object^ obj = MtAdapter::GetInstance()->GetNamedParameter(expertHandle, gcnew String(paramName));
if (obj != nullptr)
*res = (__int64)obj;
return true;
}, err, false);
} }
+25 -31
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
@@ -19,41 +19,37 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}</ProjectGuid> <ProjectGuid>{2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}</ProjectGuid>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>MTConnector</RootNamespace> <RootNamespace>MTConnector</RootNamespace>
<ProjectName>MTConnector</ProjectName> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CLRSupport>true</CLRSupport> <CharacterSet>Unicode</CharacterSet>
<CharacterSet>NotSet</CharacterSet> <PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<CLRSupport>true</CLRSupport> <CharacterSet>Unicode</CharacterSet>
<CharacterSet>NotSet</CharacterSet> <PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<CLRSupport>true</CLRSupport> <CLRSupport>true</CLRSupport>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@@ -73,26 +69,30 @@
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\products\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)build\products\$(Configuration)\x86\</OutDir>
<LibraryPath>$(SolutionDir)thirdparty\libs;$(LibraryPath)</LibraryPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\products\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)build\products\$(Configuration)\$(Platform)\</OutDir>
<LibraryPath>$(SolutionDir)thirdparty\libs;$(LibraryPath)</LibraryPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\products\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)build\products\$(Configuration)\x86\</OutDir>
<LibraryPath>$(SolutionDir)thirdparty\libs;$(LibraryPath)</LibraryPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\products\$(Configuration)\$(Platform)\</OutDir> <OutDir>$(SolutionDir)build\products\$(Configuration)\$(Platform)\</OutDir>
<LibraryPath>$(SolutionDir)thirdparty\libs;$(LibraryPath)</LibraryPath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)MtService;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -105,6 +105,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)MtService;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -116,6 +117,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)MtService;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -127,6 +129,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionDir)MtService;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -140,7 +143,6 @@
<ClInclude Include="Stdafx.h" /> <ClInclude Include="Stdafx.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="MTConnector.cpp" /> <ClCompile Include="MTConnector.cpp" />
<ClCompile Include="Stdafx.cpp"> <ClCompile Include="Stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
@@ -156,20 +158,12 @@
<ItemGroup> <ItemGroup>
<ResourceCompile Include="app.rc" /> <ResourceCompile Include="app.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="cl.resx" /> <EmbeddedResource Include="cl.resx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MTApiService\MTApiService.csproj"> <ProjectReference Include="..\MtService\MtService.vcxproj">
<Project>{de76d5c7-b99c-4467-8408-78173bdd84e0}</Project> <Project>{3effff03-2a1d-48aa-a49a-9f90889f31e0}</Project>
<Private>false</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-3
View File
@@ -29,9 +29,6 @@
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="AssemblyInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Stdafx.cpp"> <ClCompile Include="Stdafx.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
+1 -1
View File
@@ -4,4 +4,4 @@
#pragma once #pragma once
#define _DLLAPI extern "C" __declspec(dllexport)