pb1 =
(CObject1*)AfxDynamicDownCast( RUNTIME_CLASS(CObject1), pb );
AfxMessageBox( pb1->m_str );
break;
case 2:
pb2=
(CObject2*)AfxDynamicDownCast( RUNTIME_CLASS(CObject2), pb );
AfxMessageBox( pb2->m_str2 );
break;
default:
AfxMessageBox( "Unkown Object!" );
break;
}
delete pb;
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/