![]() Standard Template Library (STL) class templates such as std::vector are excellent containers for C++ code inside module boundaries, and I encourage you to use those in such contexts. ![]() In this article, I’ll discuss C++ code samples of increasing complexity to create safe arrays storing different kinds of data using ATL helper classes, including CComSafeArray. However, for C++ programmers, instead of working at the C-interface level, it’s more convenient to use higher-level C++ classes, such as the Active Template Library (ATL) CComSafeArray. For further details on the SAFEARRAY C data structure and some of its native C-interface APIs, see the online companion piece to this article, “Introducing the SAFEARRAY Data Structure” ( /magazine/mt778923). There are also C-interface Windows APIs for manipulating safe arrays, such as SafeArra圜reate and SafeArrayDestroy for creation and destruction, and other functions to lock a safe array instance and safely access its data. ![]() A safe array is usually handled in code via a pointer to its SAFEARRAY descriptor, that is, SAFEARRAY*. Basically, the SAFEARRAY data structure describes a particular instance of a safe array, specifying attributes such as its number of dimensions and a pointer to the actual safe array’s data. The Windows programming platform offers a convenient ready-to-use data structure that can be used for that purpose: the SAFEARRAY, whose definition can be found on the Windows Dev Center ( bit.ly/2fLXY6K). Passing that data across module boundaries isn’t trivial and requires the use of well-designed and well-crafted data structures. Or, you might have a Windows service written in C++ that interacts with other low-level modules and returns arrays of strings that you want to consume in GUI clients written in C#, or in a scripting language. For example, you might have some C++ components that interact with some hardware and produce an array of data, like an array of bytes representing the pixels of an image read from an input device, or an array of floating point numbers representing measurements read from a sensor. Tracking your deliveries is a great way to make sure your packages land in your hands-not those of a porch pirate.Often, you want to exchange some data in the form of arrays between those components. ![]() That way I can either make sure I'm home when the package is delivered, or ask a friend or neighbor to grab it for me. I get alerts from Amazon, USPS, and UPS that tell me when my delivery is within five or fewer stops of my house. Most delivery companies-including Amazon-let you track your package from the warehouse right up to your porch. That way, if you’re not home to accept the delivery, your packages won’t be left unattended.Īnother way to prevent package theft is to sign up for package delivery tracking. Another way to ensure secure delivery is to require a signature upon receipt. It may not be quite as convenient as receiving deliveries at your front door, but one sure way to guarantee safety is to have packages held at the post office or delivery service store until you can pick them up yourself.īoth FedEx and UPS provide options for you to have packages held at a local location rather than dropped off at your home.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |