locked
AccessDeniedException in C++ call to ConnectAsync - XAML version works fine, JS fails

    Question

  • I'm starting from the SmoothStreaming sample, and replacing the Byte Stream Handlers with a scheme handler to handle "http:", then specifying the video tag in the HTML files as a URL linking to a file I want to request from a server.

    I have added a C++ project to the solution, with an ActivateableClass, and I give the class's ID to registerSchemeHandler. This works to the extent that if I set the "Internet (Client)" capability in the manifest, a breakpoint in my scheme handler is hit. But if I also (or only) turn on "Private Networks" the C++ class never gets called.

    With just "internet (Client)" (or "Client and Server") turned on, when I call ConnectAsync to connect to a URL, I get an AccessDeniedException. I can connect to it on a browser. I think ConnectAsync fails because the URL refers to a server on our private network, which is why I want to use the Private Network capability. But if I turn that on, the C++ isn't called at all!

    Can you tell me what's going on? I'm almost sure I need the private network capability. Is there something else I need to do before that will work?

    I have added an Extension section to the manifest, which specifies the ActivatableClassId, I have an IDL file which specifies it as a runtimeclass, and of course I have an ActivatableClass macro in the class itself....what am I missing???

    I have a XAML based version which uses the exact same C++ code, and that works fine. But I've been told we need a JS/HTML version.

    Thanks in advance for any advice!

    Thursday, October 10, 2013 4:00 AM

Answers

  • Hi CharlesRGoodwin,

    Welcome back!

    If so, I advise you to post this thread on Building Windows Apps with JS/HTML5 forum for more professional and helpful response.

    Note:

    Please leave here a link to your new thread and mark the reply as answer, so more callers could find your thread quickly.

    Thanks for your understanding!

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 14, 2013 1:55 AM
    Moderator

All replies

  • Hi CharlesRGoodwin,

    Welcome to MSDN forum!

    According to your description, I am not sure which language are you going to use ? C++/XAML or JS/HTML?

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 11, 2013 7:04 AM
    Moderator
  • Thank you!

    The application that doesn't work correctly uses JS/HTML5. I have an equivalent one using XAML with the same C++ code attached, which works OK.

    Sunday, October 13, 2013 8:29 PM
  • Hi CharlesRGoodwin,

    Welcome back!

    If so, I advise you to post this thread on Building Windows Apps with JS/HTML5 forum for more professional and helpful response.

    Note:

    Please leave here a link to your new thread and mark the reply as answer, so more callers could find your thread quickly.

    Thanks for your understanding!

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 14, 2013 1:55 AM
    Moderator
  • Thanks. The link to the new thread is:

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/882e810c-8a20-4ad4-b07d-37c3028b43ee/accessdeniedexception-in-c-call-to-connectasync-xaml-version-works-fine-js-version-fails?forum=winappswithhtml5

    PS - sorry, I can't make it an actual link until my account is verified. I'm not sure what that means, so I will have to leave it as it is for now.


    Monday, October 14, 2013 3:26 AM
  • Hi CharlesRGoodwin,

    Welcome Back!

    I have edited your reply and modify the link.

    Thanks for your understanding!

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 14, 2013 5:33 AM
    Moderator