I'm guessing that you declared MySort as a member function of CModel. It may make more sense to declare it as a non-member function, or maybe a static member function. (And rename it, since it compares, not sorts.)

Hey look, the same answer you got yesterday. If you don't understand the response, perhaps you should ask for clarification rather than jumping from forum to forum hoping someone will answer it in simpler terms.