Assuming these are functions and not methods, you probably do not need to make the function static, you are creating the object inside the function dynamically, which means you only need to return the pointer to the object
Quote:
Code:
static CSomeObject* SomeFunc1()
{
CSomeObject object = new CSomeObject;
......
......
return object;
}
|
Code:
CSomeObject* SomeFunc1()
{
CSomeObject* object = new CSomeObject; //Should object also be a pointer.
......
return object;