A
Alex Tenenboym
This is a typical way to get a return from a function
#define MY_PROC_ERR 0
#define MY_PROC_PARTIAL_SUCCESS 1
#define MY_PROC_FULL_SUCCESS 2
int CSomeClass::MyProc(...)
{
//Do processing
return iRet;
}
void CAnotherClass::OnProc
{
CSomeClass someclass_object;
switch(someclass_object.MyProc(...))
{
case MY_PROC_ERR:
ShowError();
break;
case MY_PROC_PARTIAL_SUCCESS:
Do AdditionalProcessing(...);
break;
case MY_PROC_FULL_SUCCESS:
Finish();
break;
}
}
Do you know a better way? Small improvements like using enum are not
suffice
Thanks
Alex
#define MY_PROC_ERR 0
#define MY_PROC_PARTIAL_SUCCESS 1
#define MY_PROC_FULL_SUCCESS 2
int CSomeClass::MyProc(...)
{
//Do processing
return iRet;
}
void CAnotherClass::OnProc
{
CSomeClass someclass_object;
switch(someclass_object.MyProc(...))
{
case MY_PROC_ERR:
ShowError();
break;
case MY_PROC_PARTIAL_SUCCESS:
Do AdditionalProcessing(...);
break;
case MY_PROC_FULL_SUCCESS:
Finish();
break;
}
}
Do you know a better way? Small improvements like using enum are not
suffice
Thanks
Alex