So I have the following code which works nicely:
CMyClass& CMyClass::operator=(DWORD rhs)
...
CMyClass exc;
exc = GetLastError();
And it does everything I expect it to (call the stuff inside the =
operator.)
I was wondering how to get it so that I can instead write it like the following:
CMyClass exc = GetLastError();
I tried using the above and it doesn't call the =
operator functionality, instead just leaving me with a class where just the default constructor has been called.
Thanks