mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-27 18:47:55 +00:00
Updated MatApi4 expert to build on last version of MT4
This commit is contained in:
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.16.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.16.0")]
|
||||
[assembly: AssemblyVersion("1.0.17.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.17.0")]
|
||||
|
||||
+13
-25
@@ -17,26 +17,14 @@ using namespace System::IO;
|
||||
using namespace System::Collections::Generic;
|
||||
using namespace System::Diagnostics;
|
||||
|
||||
struct MqlStr
|
||||
void convertSystemString(wchar_t* dest, String^ src)
|
||||
{
|
||||
};
|
||||
|
||||
void mqlStrFromNetStr(MqlStr* dst, String^ src)
|
||||
{
|
||||
char* numPtr2 = *((char**) (dst + 4));
|
||||
char* numPtr = (char*) Marshal::StringToHGlobalAnsi(src).ToPointer();
|
||||
int num = strlen(numPtr);
|
||||
int num2 = 0x80;
|
||||
if (num >= num2)
|
||||
{
|
||||
num = num2 - 1;
|
||||
}
|
||||
strncpy_s(numPtr2, (unsigned int) num2, numPtr, (unsigned int) num);
|
||||
Marshal::FreeHGlobal((IntPtr) numPtr);
|
||||
*((int*) dst) = num;
|
||||
pin_ptr<const wchar_t> wch = PtrToStringChars(src);
|
||||
memcpy(dest, wch, wcslen(wch) * sizeof(wchar_t));
|
||||
dest[wcslen(wch)] = '\0';
|
||||
}
|
||||
|
||||
int _stdcall initExpert(int expertHandle, int port, char* symbol, double bid, double ask, MqlStr* err)
|
||||
int _stdcall initExpert(int expertHandle, int port, wchar_t* symbol, double bid, double ask, wchar_t* err)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -46,14 +34,14 @@ int _stdcall initExpert(int expertHandle, int port, char* symbol, double bid, do
|
||||
}
|
||||
catch (Exception^ e)
|
||||
{
|
||||
mqlStrFromNetStr(err, e->Message);
|
||||
convertSystemString(err, e->Message);
|
||||
Debug::WriteLine("[ERROR] MTConnector:initExpert(): " + e->Message);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _stdcall deinitExpert(int expertHandle, MqlStr* err)
|
||||
int _stdcall deinitExpert(int expertHandle, wchar_t* err)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -61,14 +49,14 @@ int _stdcall deinitExpert(int expertHandle, MqlStr* err)
|
||||
}
|
||||
catch (Exception^ e)
|
||||
{
|
||||
mqlStrFromNetStr(err, e->Message);
|
||||
convertSystemString(err, e->Message);
|
||||
Debug::WriteLine("[ERROR] MTConnector:deinitExpert(): " + e->Message);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _stdcall updateQuote(int expertHandle, char* symbol, double bid, double ask, MqlStr* err)
|
||||
int _stdcall updateQuote(int expertHandle, wchar_t* symbol, double bid, double ask, wchar_t* err)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -76,7 +64,7 @@ int _stdcall updateQuote(int expertHandle, char* symbol, double bid, double ask,
|
||||
}
|
||||
catch (Exception^ e)
|
||||
{
|
||||
mqlStrFromNetStr(err, e->Message);
|
||||
convertSystemString(err, e->Message);
|
||||
Debug::WriteLine("[ERROR] MTConnector:updateQuote(): " + e->Message);
|
||||
return 0;
|
||||
}
|
||||
@@ -127,7 +115,7 @@ int _stdcall sendDoubleResponse(int expertHandle, double response)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _stdcall sendStringResponse(int expertHandle, char* response)
|
||||
int _stdcall sendStringResponse(int expertHandle, wchar_t* response)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -239,11 +227,11 @@ int _stdcall getDoubleValue(int expertHandle, int paramIndex, double* res)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int _stdcall getStringValue(int expertHandle, int paramIndex, MqlStr* res)
|
||||
int _stdcall getStringValue(int expertHandle, int paramIndex, wchar_t* res)
|
||||
{
|
||||
try
|
||||
{
|
||||
mqlStrFromNetStr(res, (String^)MtServerInstance::GetInstance()->GetCommandParameter(expertHandle, paramIndex));
|
||||
convertSystemString(res, (String^)MtServerInstance::GetInstance()->GetCommandParameter(expertHandle, paramIndex));
|
||||
}
|
||||
catch (Exception^ e)
|
||||
{
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.18.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.18.0")]
|
||||
[assembly: AssemblyVersion("1.0.19.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.19.0")]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<?define ProductName="MtApi" ?>
|
||||
<?define ProductVersion="1.0.18" ?>
|
||||
<?define ProductVersion="1.0.19" ?>
|
||||
<?define Manufacturer="DW"?>
|
||||
|
||||
<Product Id="*"
|
||||
|
||||
@@ -82,6 +82,10 @@
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MtApi, Version=1.0.19.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Program Files (x86)\MtApi\MtApi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -148,12 +152,6 @@
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MtApi\MtApi.csproj">
|
||||
<Project>{7A76C388-A8FB-4949-8170-24D4742E934E}</Project>
|
||||
<Name>MtApi</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Binary file not shown.
+266
-266
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user