DLL critical error

 

Hi,

I wrote one dll that after it starts to work after 10-20 minutes get below error in my MT4:

2011.10.13 19:04:28 Indi1 EURUSD,M15: function 'ind_Ichimoku' call from dll 'C_Source.dll' critical error

When starts it works properly but after a while I get above error.

In dll I am using dynamic arrays.

Maybe problem is due memory?

Regards,

 

Add some print statements to find out where and why - critical error says nothing.

OutputDebugString() can be used in dll's and mql4 code

/**
* send information to OutputDebugString() to be viewed and logged by
* SysInternal's DebugView (free download from microsoft) This is ideal for
* debugging as an alternative to Print(). The function will take up to 10
* stringa (or numeric) arguments to be concatenated into one debug message.*/
#import "kernel32.dll"
   void OutputDebugStringA(string msg);
#import
void log(string s1,    string s2="", string s3="", string s4="", string s5="",
         string s6="", string s7="", string s8="", string s9="", string s10=""){
        string out = StringConcatenate(WindowExpertName(), ".mq4 ", Symbol(), " ",
                                   s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
        OutputDebugStringA(out);
}