我有一个使用C++/CLI的项目。然后我有一个像这样的事件处理程序:
void NotificationSystemEventHandler::NotificationServiceDetailViewRequested(System::Object^ sender, Notifications::NotificationViewer::DetailViewOpenRequestedEventArgs^ e)
{
try
{
switch (e->Type->ID)
{
(...)
DetailViewOpenRequestedEventArgs
类具有一个称为Type
类型的DomainModel::CMN::NotificationType^
的属性NotificationType
类具有一个称为int类型的ID的属性。当我访问该属性时,我得到一个C2039,它说ID实际上不是NotificationType
的成员,因为我可以在对象浏览器中看到该属性。最佳答案
删除所有引用并将它们再次添加到项目中可以解决此问题。
https://stackoverflow.com/questions/13878003/