Problem with String array and C++ DLL

 

Hi,


i am having a problem with the above. Im pretty sure its due to the some sort of size limit / restriction with the string variable type in MT4 but i would welcome others thoughts.


I have a single dimensional string array with 40 elements.


some of these elements are set to specific values during init() others are there as place holders for later use.


there are three elements that need to be set by a DLL with information received from an external source. i am using arr[20], arr[25], arr[30] for these. before i run the DLL i allocate these elements using arr[20] = "" in MQ4 to ensure that its initialized.


the values that i am setting these are pretty big, they are GUID values, which have the format as such "4dfd5316-9605-4aad-b193-459d98527333" the first one i set works fine for example arr[20], but when i go to set subsequent ones, i get very strange results


sometimes arr[20] and arr[25] will be both overwritten with arr[30] other times when i set arr[30] arr[25] will contain arr[25] and arr[30] concatenated together. i have ruled out any problems in the C++ code, as when i set them to smaller values, i have no problems, all if fine.


all i can assume is that because the value is quite large, the String variable type has not allocated enough space for it and as such its overrunning the array. i tried initializing with a larger value, for example arr[20] = "4dfd5316-9605-4aad-b193-459d98527333" but i just got more unpredictable results.


any ideas? i do have a work around for this, but it will then put more load onto the server which i want to avoid at all cost .....