locked
Help converting this single line from c# to c++

    Question

  • Using code from : https://rtaudiowsapps.codeplex.com/

    the c# code is:

     

    GuitarFX_Audio.AudioFX m_AudioFX; ... m_AudioFX = await AudioFX.CreateAsync(

                    MediaDevice.GetDefaultAudioCaptureId(AudioDeviceRole.Default),

                    MediaDevice.GetDefaultAudioRenderId(AudioDeviceRole.Default));


    I have so far converted it to:

    m_AudioFX = AudioFX::CreateAsync(
    		MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default),
    		MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default));

    What do I convert this line to?

    GuitarFX_Audio.AudioFX m_AudioFX;

    Thank you. I am new to store development.

    Paul.


    Saturday, August 30, 2014 6:19 PM

Answers

  • Await in c# needs to be converted to create_task in c;++
    Sunday, August 31, 2014 4:18 AM
  • See this for more help: Asynchronous programming in C++

    To definite a variable on C++ is almost same as what we do in C#, Visual C++ language reference and Ref classes and structs

    GuitarFX_Audio.AudioFX^ m_AudioFX;

    Should be fine

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.




    Tuesday, September 09, 2014 7:20 AM
    Moderator

All replies

  • I am using this code:

    property Windows::Foundation::IAsyncOperation<GuitarFX_Audio::AudioFX ^> ^   m_AudioFX;

    How do I call one of it's methods, this does not compile:

    m_AudioFX->Start();

    Sunday, August 31, 2014 3:36 AM
  • Await in c# needs to be converted to create_task in c;++
    Sunday, August 31, 2014 4:18 AM
  • So it should become:

    m_AudioFX = create_task(AudioFX::CreateAsync(
    		MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default),
    		MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default)));

    What should this line become:

    GuitarFX_Audio.AudioFX m_AudioFX;
    Thanks.

    Sunday, August 31, 2014 9:49 AM
  • See this for more help: Asynchronous programming in C++

    To definite a variable on C++ is almost same as what we do in C#, Visual C++ language reference and Ref classes and structs

    GuitarFX_Audio.AudioFX^ m_AudioFX;

    Should be fine

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.




    Tuesday, September 09, 2014 7:20 AM
    Moderator