Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

Wrong error C2039 in VS2012 with a C++/CLI

I have a project using C++/CLI. Then I have an event handler like this one:

void NotificationSystemEventHandler::NotificationServiceDetailViewRequested(System::Object^ sender, Notifications::NotificationViewer::DetailViewOpenRequestedEventArgs^ e)
{
    try
    {
        switch (e->Type->ID)
        {
            (...)

The class DetailViewOpenRequestedEventArgs has one property called Type of type DomainModel::CMN::NotificationType^

Then the NotificationType class has a property called ID of type int. When I'm accessing the property I get a C2039 saying that ID is not a member of NotificationType when it really is as I can see the property on the Object Browser.

The only strange thing is that Intellisense gives an error when trying to find the type and says that the type has no members but seems as the compiler can still resolve the type correctly but not its members.

I'm using the class at several other places. I can supply more info / images if requested to help clarify things.

These are the images of the issue:

The error message: The error message

The object browser: The object browser

The wrong popup: enter image description here

Upvotes: 0

Views: 583

Answers (1)

Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

Removing all the references and adding them again to the project solved the issue ....

Upvotes: 1

Related Questions