diff --git a/MTApiService/Properties/AssemblyInfo.cs b/MTApiService/Properties/AssemblyInfo.cs index 2c81b50c..1e3abce3 100755 --- a/MTApiService/Properties/AssemblyInfo.cs +++ b/MTApiService/Properties/AssemblyInfo.cs @@ -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")] diff --git a/MTConnector/MTConnector.cpp b/MTConnector/MTConnector.cpp index 5dee4995..83e799ef 100755 --- a/MTConnector/MTConnector.cpp +++ b/MTConnector/MTConnector.cpp @@ -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 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) { diff --git a/MtApi/Properties/AssemblyInfo.cs b/MtApi/Properties/AssemblyInfo.cs index b1c1fef5..2f638038 100755 --- a/MtApi/Properties/AssemblyInfo.cs +++ b/MtApi/Properties/AssemblyInfo.cs @@ -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")] diff --git a/MtApiInstaller/Product.wxs b/MtApiInstaller/Product.wxs index 0350b1a9..fc345a22 100755 --- a/MtApiInstaller/Product.wxs +++ b/MtApiInstaller/Product.wxs @@ -1,7 +1,7 @@ - + true + + False + C:\Program Files (x86)\MtApi\MtApi.dll + @@ -148,12 +152,6 @@ true - - - {7A76C388-A8FB-4949-8170-24D4742E934E} - MtApi - -