i am the "proud" heir of an old VC++ DLL and try to understand a problem with it. My predecessor used some union/struct constructions for dataprocessing. Now i debugged it to a point he put the data in the struct, but the whole app crashes, printing a memory dump and no try-catch works.
A small CodeExample.
MyCode.h:
union
{
struct
{ double _dm;
};
struct
{ double _dm;
bool _links;
};
struct
{ double _dm;
double _dummy;
double _angle;
};
struct
{ double _dm;
double _angle;
double _dummy1;
string _name;
string _descr;
double _param_d1, _param_d2, _param_d5;
double _dummy2;
string _dummy3;
int _epuzae;
int _param_i2;
string _sob, _snr2, _param_s3, _param_s4;
void *_data;
};
struct
{ void *_data;
};
}
MyCode.cpp
... Rest of the method...
_dm = 100; // Will be set
_angle = 0; // Will be set
_dummy1 = 0; // Will be set
_name = "Unittest"; // Here it crashes the whole app
_descr = "This is a test";
_param_d1 = 1;
_param_d2 = 2;
_param_d5 = 5;
_dummy2 = 0;
_dummy3 = "";
_epuzae = 99;
_param_i2 = 101;
...
Is there a method to test what struct constructor is called or what i am doing wrong here?
Best regards
Lord_Pinhead