locked
intellisense bug?

    Question

  • With both build 8250 and 8400 I get an intellisense error on what I believe to be a valid line of code.

    ref class NetworkListener sealed {
    internal:
    	NetworkListener( WFReachabilityBroker& owner );
    public:
    	void onNetworkStatusChange( Object^ sender );
    private:
    	WFReachabilityBroker& mOwner;
    };
    
    ...
    
    mNetworkListener = ref new NetworkListener( *this );
    
    // setup to start listening to status changes
    
    // the following line triggers an incorrect Intelligense error:
    // invalid delegate initializer -- expected either '(<function-address>)' or '(<object-handle>, <member-address>)' 
    // These variations also don't work:
    // mNetworkStatusCallback = ref new NetworkStatusChangedEventHandler(  [this] (Object^ sender) { networkStatusChanged(); }) );
    // mNetworkStatusCallback = ref new NetworkStatusChangedEventHandler( onNetworkStatusChange );
    // mNetworkStatusCallback = ref new NetworkStatusChangedEventHandler(  this,  &WFReachabilityBroker::networkStatusChanged );
    mNetworkStatusCallback = ref new NetworkStatusChangedEventHandler( mNetworkListener, &NetworkListener::onNetworkStatusChange, CallbackContext::Same );
    

    The error has mNetworkListener underlined in red. 

    Regards, Guy

    Monday, June 18, 2012 10:26 PM

Answers

  • Yes, this is an intellisense bug. Looks to be fixed post RC as I can no longer reproduce it on internal builds.

    -Steve

    Tuesday, June 19, 2012 1:06 AM
    Moderator