I am trying to pass a pointer to an array from EasyLanguage code to a C++ dll. I tried printing the first element of the array and it returns different values. (it should return 5 but returns1084227584). I also tried checking the address of the array in C++ and it does not match the address in EL. Any suggestions?? Thanks.
Easy language code:
VAR: temp(0);
DefineDLLFunc: "....\TestProjCDLL.dll",LPINT,"MyTest",LPINT;
Array:TestArray[2](0);
TestArray[0]= 5;
TestArray[1]= 1;
temp =MyTest(&TestArray[0]);
print(date,temp);
C++ code:
int CTestProjCDLL::MyTest(int *arr)
{
return arr[0];
}
Easy language code:
VAR: temp(0);
DefineDLLFunc: "....\TestProjCDLL.dll",LPINT,"MyTest",LPINT;
Array:TestArray[2](0);
TestArray[0]= 5;
TestArray[1]= 1;
temp =MyTest(&TestArray[0]);
print(date,temp);
C++ code:
int CTestProjCDLL::MyTest(int *arr)
{
return arr[0];
}