Help on MQL call VC6.0 Win32 Dynamic-Link Library

 

1 I create a VC6.0 Win32 Dynamic-Link Library project, new one file, the code:

#define MT4_EXPFUNC __declspec(dllexport)int a=0;
extern "C" MT4_EXPFUNC int __stdcall GetValue()
{
return a++;
}

build one lib: DLIB.dll

Copy DLIB.dll in the folder:MetaTrader 4\experts\libraries

2 mql code:

#import "DLIB.dll"
int GetValue();
#import
int start()
{
//----
int a=GetValue();
Print(a);//
//----
return(0);
}

build, no error.

run, the error message:

cannot call function 'GetValue' from dll 'DLIB.dll'

Thanks very much.

Files:
code.rar  6 kb
 
how to code win32 dll ?
 
thank you very much
 
Tks!
your idea its a lifesaver!

worked here... for me...