Trying to call C++ dll from mql4 code

 

Hello All,

Greetings of the day!!

I get the following error when I attach my Indicator to a chart. Basically my indicator tends to call a DLL file which I have placed in "Libraries" and I have also enabled "Allow Dll import"


TradingForecast AUDUSD,H1: uninit reason 8

TradingForecast AUDUSD,H1: not initialized
TradingForecast AUDUSD,H1: unresolved import function call
Cannot call 'TradingForecast.dll::SetFileName', 'TradingForecast.dll' is not loaded
TradingForecast AUDUSD,H1: 0
Cannot load 'C:\Users\Bond\AppData\Roaming\MetaQuotes\Terminal\TerminalCode\MQL4\Libraries\TradingForecast.dll' [193]



Please help me with this.


Thank You.

 
Bond: and I have also enabled "Allow Dll import"

In the indicator's options and in the main options?

 
William Roeder:

In the indicator's options and in the main options?

Yes Sir I already enabled at both the places.
 
Let us see the codes
 
Bond:


Cannot load 'C:\Users\Bond\AppData\Roaming\MetaQuotes\Terminal\TerminalCode\MQL4\Libraries\TradingForecast.dll' [193]

  • DLL file name must be "TradingForecast.dll"
  • DLL file might be corrupted.
  • Try "Data Folder" instead of "Common Data Folder", so at MT4, click "File">"Open Data Folder", then navigate to "MQL4">"Libraries", and paste DLL file there, you may also put DLL file in the same folder of the indicator.
 
Mohammad Hossein Sadeghi:

  • DLL file name must be "TradingForecast.dll"
  • DLL file might be corrupted.
  • Try "Data Folder" instead of "Common Data Folder", so at MT4, click "File">"Open Data Folder", then navigate to "MQL4">"Libraries", and paste DLL file there, you may also put DLL file in the same folder of the indicator.
Okay Sir I will try.
Reason: