I have an MFC MDI application in which I need to use the active CDocument's file icon. I know that the icon ID is set when specifying the document template (it is the first parameter in the CMultiDocTemplate constructor), but having searched the documentation (and header files) for CDocument, CMultiDocTemplate and CDocTemplate I can find no way to retrieve the icon's ID. Unfortunately all are defined in afxwin.h, so the source code isn't accessible. CDocTemplate does have a protected member variable, m_nIDResource which I'm guessing is set to the resource ID passed to the constructor, but there is no accessor for this variable.
I could write a thin wrapper class for CMultiDocTemplate and provide an accessor for the icon ID, but I thought I'd ask first if anyone has found a way to get the file icon?