You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all, I am trying to pass data type long exactly timestamp to c# dll but it's gives only one value or zero value ... I don't why.... here is my code
c#
public class ExportAll
{
[DllExport("TestFill", CallingConvention = CallingConvention.StdCall)]
public static int TestFill (
[MarshalAs(UnmanagedType.LPWStr)] string common_path,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0,ArraySubType = UnmanagedType.I8), In, Out] long[] times)
{
int originalCodePage=0;
try
{
if (originalCodePage == 0)
originalCodePage = Encoding.Default.CodePage;
string str = Encoding.GetEncoding(originalCodePage).GetString(Encoding.GetEncoding(1252).GetBytes(common_path));
Directory.CreateDirectory(str);
Logger.SetLogPath(str);
Logger.Info($"times length {times.Length}");
for (int i = 0; i < times.Length; i++)
{
Logger.Info($"time is {times[i].ToString()}");
}
return 0;
}
catch (Exception ex)
{
Logger.OnException(ex);
}
return -1;
}
}
mql4
#import "ClassLibraryTest.dll"
int TestFill(string,long ×[]);
#import
void TestLong() {
long tlong[3]= {1111111,22222222,33333333};
TestFill(Terminal.CommonDataPath(), daytimes);
}
Any help....thanks..