When using the MFC class, why not create an object in one step, but first construct the object, then call the create () member function? Use two steps to have the following benefits:
First, you can return an error code. The C constructor cannot return an error code, and the New operation throws an exception when the memory is insufficient. Use two-step method to eliminate this drawback, return an error code in the create () function.
Second, it reduces the overhead of the constructor. You can add multiple objects in a class, but you don't need to create them in the constructor, so you don't add the overhead of the constructor of this class.