I’m trying to call Error(“My Test”) in normal cpp class (Not a COM object, but this class will be used by COM). In the compilation, I get error saying
‘Error’: identifier not found
I have included #include in the cpp file. Please explain why it does not work.
NOTE: I can use Error() inside COM object successfully
Thank you
Error()is a static member function ofCComCoClass. You could call it directly, but you would need to provide the template parameters which is not very convenient. Instead you can callAtlReportError()which is whatError()does internally.