I create a STRUCT. My STRUCT is composed only by BYTE datas.
I would like to know how can I do for use this STRUCT in a CByteArray or other.
For example : CByteArray.RemoveAll; CByteArray.Add; ...
If you want to store object/structs of your own, try the CArray template class. Or you can store pointers to your items in CPtrArray. Or derive from CObject and use CObArray. Or derive a CTypePtrArray class. I suggest you read the MSDN sections about collection classes (there's a lot of them). Personally though I'd use the STL classes. Here's how you can do it in STL:
This creates a vector of CRecords and does some stuff with it.
The operator overloads in the record struct are needed for operations like find and sort. If you don't need these, you don't need the operators. If you need MFC serialisation, you could add that pretty easily too, I would guess. I just can't help it, I like MS...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.