Here is my new problem:
I am passing a cluster to a DLL function, in this DLL function I want to fill the data of the cluster. So, it works perfectly when I do it with simple elements, but when the cluster has strings or arrays inside, I fill it with the structure explained in How LabVIEW Stores Data in Memory.
_declspec (dllexport) long fillCluster(char* struct_ptr) {
int j;
char* auxS;
char sh[]= "Hello, it works!";
// The cluster stores a handle, that is a pointer to a pointer to the string
auxS = *(*(char***)struct_ptr);
// Write the size
*auxS = strlen(sh);
auxS += sizeof(long);
for(j=0;j<strlen(sh);j++){
auxS[j]=sh[j];
}
return 0;
}
And I can see in my VI that the string gets filled correctly. But then, when I try to save the VI, I get this error:
Fatal Internal Error: "fsane.cpp", line 442
LabVIEW version 10.0f2
It seems than some object is making the sanity check fail... so probably it is because I am not filling the cluster object correctly and it gets corrupted. Do I have to allocate the memory for the cluster? for the string inside the clusert? How?
Can anyone show me how to fill a cluster that is passed to a DLL function as a parameter (pointer to the cluster).
Any sample code or example will be very appreciated.
Thank you very much.
Edited by jbone, 15 February 2011 - 11:33 PM.














