DLL导入问题

 

MT4\Experts\samples中有一个导入DLL的例子,试了一个不能导入。我自已做了个简单的试验,也不能导入

my_dll:用VC6生成DLL



//my_dll.cpp
#include "stdafx.h"


BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{

switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}


__declspec(dllexport) int __stdcall plus(int x,int y)
{
return(x+y);
}


//my_dll.def

LIBRARY my_dll

EXPORTS plus
LIBRARY


// my_dll.mqh 放在MT4\experts\includes

#import "my_dll.dll"
int plus(int ,int );

#import

//my_dll.mq4 放在MT4\experts\libraries 和 c:\windows\system32都试过

#include <my_dll.mqh>

..........
int start()
{ int tot=plus(4,5);Print(tot); return(0); }


选择允许导入外部动态链接库。


结果:my_dll EURUSD,M30: dll calls are not allowed; 'my_dll.dll'-'plus'
my_dll EURUSD,M30: expert stopped
我用samples中的exportfunctions得到同样的结果。

请问如何解决?








 
You need to check up parameter "Allow DLL imports"

 
And properties of expert