08-30-2006 03:25 AM
08-30-2006 04:38 AM
08-30-2006 04:53 AM
Unfortunately the suggestion didn't make any difference 😞 Because of the crash when calling the GetData function, the code never reaches the free() command.
Previously I also tried this way :
InsertTextBoxLine (panelHandle, PANEL_txtWinMSG, -1, GetData());
Oh and there's a typo in my first message, the prototype should be named GetData.
08-30-2006 05:25 AM
What about the calling conventions? A few years back we had a similar situation when someone devloped a dll for us - most of the routines worked but when we investigated why some didn't we discovered that they had used the wrong calling convention. Could be worth double-checking whether the dll (and hence the header file) requires a _cdecl or _stdcall prefix to the prototypes.
JR
08-30-2006 05:39 AM
08-30-2006 06:12 AM
I've not been much help so far ![]()
Is the dll a commercial offering? Do you know if it has been used successfully elsewhere? Can you contact its suppliers/writers for help and/or more information - for example what is the maximum size of string that can be returned. On second thoughts that can't be your problem, if the crash occurs inside the dll function. Presumably the CVI debugger can shed no light on this, either.
Returning a pointer can be problematic with careless programming; I have seen cases where a local pointer has been created, manipulated and then returned from a function - the author having forgotten that at this point the local pointer (allocated on the stack of the function) becomes garbage. I would expect that a properly written and tested library would take pains to ensure that this could not happen.
I'm fast running out of suggestions - anyone else got some ideas?
JR