Greets. I know a number of different script languages a bit and a fair bit of vb, but now I find an urge to mess with c++. While the language is pretty extensive, I can figure out how to do most common things.
I recently was messing with arrays, specifically 2 dimensional. Reading a shared memory segment. I seem to have accomplished that as I can cout the data stepping through the array(s), which is actually a typdef struct.
Anyway, I was interested in seeing how my fav script language AutoIT interfaces with a dll, so I thought to turn my simple array into a exported data.
Many examples later I am lying with a very simple dll using __declspec(dllexport) int GetData(), where the array is int array[99][2]. The original example I was viewing used a declaration like this
__declspec(dllexport) LPCTSTR RetrieveTempFilename(LPCTSTR szDirectory, LPCTSTR szPrefix), where this simple dll you passed in a path and filename, and were returned the file name or full path.
So, I have now a dllexport that calls my function with reads the memory segment. I have intialized the array[99][2] and successfully filled it with data. Now is where I am stuck.
I do not explicitly understand the pointer yet. I sort of get it, but have yet to really apply it to a project. FYI.
The problem is that I am expecting to declare the dllexport as
however the datatype to return, array[99][2] does not want to coerce into int. Initalizing iArray[] and trying to use that as the datatype does not work either.
Now I also think that I can pass in a pointer to my array that has been dimensioned in AutoIT. I do not know if that needs to be dimensioned as aArray[][] or not, as usually when calling a dll in AutoIT you Dim aArray and then go aArray = dllcall() -> resulting array of whatever the dll returns.
So, while I have code, and am happy to post it if need be, perhaps there is a logical explanation. Not that I mind anyone doing it for me sometimes, but I often learn best when swimming with sharks. :)