How to get the pointer of an object by name?

 
How to get the pointer of an object by name?

I created a local object in a function using the new operator and added it to a CObject array declared in global scope. Now in another function I want to get the pointer of that object by the object name.

Is there a function that will do this or will I have to develop the solution?do this or will I have to develop the solution?
 
Samuel Manoel De Souza:

The only function to get the pointer is ::GetPointer()

If you create an object with new , you already have its pointer and can store it somehow for future usage. 

ptr* name = new ptr;
Reason: