Hi, Disch and kfmfe04. Thanks for your answers.
Well, I didn't go into the origin of this datatype, because I didn't want to confuse you. This is a data structure that is imported from LabView. In my application, I make LabView call a C++ dll, and I need to transfer the data from the first to the second. In LabView there are tools that convert a LabView data structure into a C/C++ data structure.
So, imagine this is the data structure I get from LabView:
1 2 3 4 5 6 7 8 9 10
|
typedef struct {
int num;
double height;
string name;
} TD2;
typedef struct {
int size;
TD2 array[1];
} TD1 **TD1Hdl;
|
Without comma I don't get a compiler error. I think using typedef you make TD1 and **TDH1Hdl to be equivalent, so TD1Hdl is a handler of TD1.
When I call the entry point of the dll from LabView, I call a function that pass a parameter of type TD1Hdl.
void function(TD1Hdl LabViewData);
Like I said, both the data structure and the function prototype are generated from LabView.
Inside my C++ dll, I include this code parts provided. Then, I need to take the data belonging to the variable I get from LabView and copy it to another data structure I have to create in C++, similar to the first, but including more information, like classes. For example:
1 2 3 4 5 6 7 8 9 10 11 12
|
typedef struct {
int num;
double height;
string name;
class1* object1;
class2 object2;
} TD4;
typedef struct {
int size;
TD4 array[1];
} TD3;
|
For example, I have to create a variable called DllData of type TD3, and copy all the information contained in variable LabViewData in the corresponding fields of the new structure.
Sorry for my English, and please, if you need me to be clearer, let me know, and I'll try to explain it better.
Thanks in advance.
Regards,
Francisco