我有此代码:
for (int iDate = 0; iDate < m_cbDates.GetCount(); iDate++)
{
auto *pEntry = (CChristianLifeMinistryEntry*)m_cbDates.GetItemDataPtr(iDate);
if (pEntry != nullptr)
pEntry->ExportStudentInfoToXML(myDoc, pStudentData, mapPublishers);
}
在Visual Studio 2019中,它发出以下代码分析警告:
我知道有几种不同类型的演员。正确的是:
auto *pEntry = static_cast<CChristianLifeMinistryEntry*>(m_cbDates.GetItemDataPtr(iDate));