Download MetaTrader 5
To add comments, please log in or register
Interessiert am Partnerprogramm MQL5.community? Veröffentliche Links und verdiene Geld damit!
och
448
och 2014.04.07 14:18 

Hi guys,
I am trying to pass an array of string to a delphi DLL, here is my code, does anyone knows what's wrong?

Delphi DLL code extract...

type StringArray = array[0..100] of PUnicodeString;

function test_string(var strValues : StringArray) : integer;stdcall;
begin

  MessageDlg(string(strValues[0]) + char(13) + char(10) +
             string(strValues[1]) + char(13) + char(10) +
             string(strValues[2]), mtInformation, [mbOK],0);
   result :=-1;
end;

MT4 code extract ...

#import "Mydll.dll"
  int test_string(string &_strValues[3]);
#import

void TestArrayStringDLL()
{
  
  string _strValues[3];
  
  _strValues[0] = "strValues_0";
  _strValues[1] = "strValues_1";
  _strValues[2] = "strValues_2";
  test_string(_strValues);
  
  return;
}  

The result should be a messagebox with strValues_0, strValues_1, strValues_3. The result is a messagebox with just the first line/value.

Any suggestions?

qjol
3243
qjol 2014.04.08 18:14  
/
To add comments, please log in or register