How to know what does error 127 of a script means?

 

I've wrote a DLL using Visual C++ 2003 based on a standard DLLSample project. My new function is GetCrossings. But when I try to use the function from a script I get an error:

cannot call function 'GetCrossings' from dll 'crossings.dll' (error 127)

When I press F1 the help isn't related to the number of the error. I've searched some description about error 127 on this site but there were no solutions. The function uses _stdcall and other things are correct. But the error occurs. Tell me please how can I know what this number of the error means and what can cause such error of a DLL function call. Or may be can I get some working example of C++ DLL and MQL4 script pair?

The function code is:

MT4_EXPFUNC void __stdcall GetCrossings (double *arr1, double *arr2, int arraysize, int *res)
  {
//----
   if((arr1!=NULL)  && (arr2!=NULL))
     {
int diff = 0;//последнее взаимное расположение
int crcnt = 0;//сколько пересечений
if (arr1[0] > arr2 [0])
diff = 1;
else
diff = -1;
crcnt=0;
for (int i=0; i<arraysize-1; i++) {//занесение почек пересечения в массив
if (((arr1[0] > arr2 [0]) && (diff < 0)) || ((arr1[0] < arr2 [0]) && (diff > 0))){
res [crcnt] = i;
crcnt++;
}
if (arr1[0] > arr2 [0])//обновление взаимного расположения
diff = 1;
else
diff = -1;
}
     }
}
 

one idea: use site search bar top right of every window. i did and got results page for search string of 127 have u seen?

may give u ideas, even if diff langs talked about...

 

"Or may be can I get some working example of C++ DLL and MQL4 script pair?"

There is a working sample included with MT4, called "sample".

Look in /experts/samples for the code... move it to appropriate folders for execution...

 

sorry for my english! but i try

i use visual studio express c++ 2010 with russian interface!!

create text file testdll1.def(for example)--->

//-----

LIBRARY testdll1

EXPORTS someFuncName

anotherFuncName

........................

//-----

You can invoke a .def file during the linker phase with the /DEF (Specify Module-Definition File) linker option.

solution-->configuration properties-->Linker-->Input--> Module-Definition File=You should specify a full path to def file!!(Example: D:\Program Files (x86)\MetaTrader - Alpari\experts\libraries\testdll1.def)


This automatically enabled /DEF option in linker!

Then build the application!

You DON'T NEED include .def file into project!!!!

good luck!!!

Reason: