Hi @bryon,
There are several errors in your code, the code can run after modification, you could refer to the following code.
struct SomeOtherStruct
{
int z;
int c;
CByteArray arr;
//...
//Some more implementation
//...
};
struct SomeStruct
{
int x;
int y;
CString someString;
std::vector<SomeOtherStruct> someOtherVector = {};
CByteArray Arr;
SomeStruct()
{
x = 0;
y = 0;
someString = "";
}
SomeStruct(const SomeStruct& s)
{
x = s.x;
y = s.y;
someString = s.someString;
someOtherVector = s.someOtherVector;
Arr.Copy(s.Arr);
}
};
class MyClass
{
public:void Exectute(SomeStruct s)
{
//...
//Do work
//...
}
};
//Fill record with data, and pass to Execute procuecure.;
int main()
{
SomeOtherStruct s;
s.z = 10;
s.c = 1;
SomeStruct somestruct;
somestruct.x = 11;
somestruct.y = 12;
somestruct.someString = "test";
somestruct.someOtherVector.push_back(s);
MyClass myclass;
myclass.Exectute(somestruct);
}
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.