古いMFCアプリケーションにいくつかの変更を加えています。ヘッダー「stdafx.h」には、クラス「CMemDC」を定義する別のヘッダー「mfcextensions.h」が含まれています。別のヘッダーに「afxtoolbar.h」を含めて、クラス「CMFCToolBar」を使用できるようにする必要があります。問題は、「afxtoolbar.h」に、クラス「CmemDC」を定義する「memdc.h」が最終的に含まれることです。その結果、当然のことながらコンパイルエラー2011が発生します。
これで、「CMemDC」を定義する既存のコードを制御できますが、これは多くの場所で使用されているため、あまり変更しないでください。
What is the best strategy for over coming this? I'm guessing that I could somehow use namespaces, or the other alternative is to rename our existing class "CMemDC" but this is more avoiding the problem rather than solving it for good.
Cheers