locked
System::Reflection namespace missing in c++

    Question

  • My code needs to open a file in assets and play it.

    But for some reason the word assembly causes an error.

    I looked it up and it needs namespace System::Reflection but this appears to be missing in C++.

    Any ideas ?

    void beep()
    {
    
    	MediaElement^ media;
    
    	auto istream = Assembly.GetExecutingAssembly().GetManifestResourceStream("beep.wav"); 
    
    media->SetSource(istream,".wav");
    media->AutoPlay = false; 
    media->Stop(); 
    media->Play();
    
    
    
    }
    
    


    n.Wright

    Tuesday, September 24, 2013 1:51 AM

Answers

  • System.Reflection is a .Net Framework namespace. C++/Cx is a native language and doesn't use .Net.

    Typically you would include your sound files directly in your project folder rather than embedding them in a DLL.

    --Rob

    Tuesday, September 24, 2013 2:20 AM
    Moderator