I am trying to load the icon associated with the application that called my function.
The way I am solving the problem for GUI applications is this:
AfxGetApp()->LoadIcon(128); // 128 is the IDR_MAINFRAME icon
However, the Afx functions, upon looking up the resource, fail for some non-gui applications, since afxCurrentResourceHandle
is NULL.
What would be a better way to find the mainframe icon?
PS. currently I can work around it by testing afxCurrentResourceHandle != NULL
... wish I could do better.