Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [WinRT] Display Microsoft ads in an app
Forum Update on Monday, May 27th 2025

[WinRT] Display Microsoft ads in an app

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 3 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adrian.gabureanu
    wrote on last edited by adrian.gabureanu
    #1

    I want to display banner and interstitial ads from Microsoft in my WinRt apps.

    First things first, I installed the Microsoft Store Services SDK. But then I ran into a little problem. According to the documentation:

    For a Universal Windows Platform (UWP) project: Expand Universal Windows, click Extensions, and then select the check box next to Microsoft Advertising SDK for XAML (Version 10.0).
    

    How can I do something equivalent in Qt Creator? How do I add an extension and how can I reference classes from the Advertising SDK? Has anyone tried this before? Is this undocumented or unsupported (yet)?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mkalinow
      wrote on last edited by
      #2

      Adding in extensions is nothing short but setting additional include/lib paths for your project.

      You will need to do this manually, in a standard installation those are available in

      C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs

      For Advertising (I am pretty sure my setup is outdated), there is Microsoft.Advertising.Xaml which contains a couple of appx packages. Those files contain the libraries as well as the winmd files. In case your SDK does not provide headers, use a search engine to check for converting winmd to header files and use those then during development.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        adrian.gabureanu
        wrote on last edited by
        #3

        Indeed, there is a Microsoft.Advertising.XAML that contains appx packages, a Microsoft.Advertising.dll and a winmd file.

        I got the header (*.h) files using winmdidl and Midlrt . But when I tried to include the header files, I got tens of C2xxx and C3xxx errors coming from the header files.

        Here are the commands used to get the header files:

        "C:\Program Files (x86)\Windows Kits\10\bin\x64\winmdidl.exe" /outdir:c:\Temp\A "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\References\CommonConfiguration\neutral\Microsoft.Advertising.winmd"
        
        "C:\Program Files (x86)\Windows Kits\10\bin\x64\Midlrt.exe" "c:\Temp\A\Microsoft.Advertising.WinRT.UI.idl" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um" /I "C:\Temp\A" /metadata_dir "C:\Windows\System32\WinMetadata" /h "C:\Temp\B\Microsoft.Advertising.WinRT.UI.h"
        

        Where did I go wrong?

        jsulmJ 1 Reply Last reply
        0
        • A adrian.gabureanu

          Indeed, there is a Microsoft.Advertising.XAML that contains appx packages, a Microsoft.Advertising.dll and a winmd file.

          I got the header (*.h) files using winmdidl and Midlrt . But when I tried to include the header files, I got tens of C2xxx and C3xxx errors coming from the header files.

          Here are the commands used to get the header files:

          "C:\Program Files (x86)\Windows Kits\10\bin\x64\winmdidl.exe" /outdir:c:\Temp\A "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\References\CommonConfiguration\neutral\Microsoft.Advertising.winmd"
          
          "C:\Program Files (x86)\Windows Kits\10\bin\x64\Midlrt.exe" "c:\Temp\A\Microsoft.Advertising.WinRT.UI.idl" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared" /I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um" /I "C:\Temp\A" /metadata_dir "C:\Windows\System32\WinMetadata" /h "C:\Temp\B\Microsoft.Advertising.WinRT.UI.h"
          

          Where did I go wrong?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @adrian.gabureanu You should say what error you get now. Especially the first error would be interesting.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          0
          • jsulmJ jsulm

            @adrian.gabureanu You should say what error you get now. Especially the first error would be interesting.

            A Offline
            A Offline
            adrian.gabureanu
            wrote on last edited by
            #5

            @jsulm For example: http://pastebin.com/aNqRHuVd

            Microsoft.Advertising.WINRT.UI.h looks like this: http://pastebin.com/t8Qhj8VZ

            jsulmJ 1 Reply Last reply
            0
            • A adrian.gabureanu

              @jsulm For example: http://pastebin.com/aNqRHuVd

              Microsoft.Advertising.WINRT.UI.h looks like this: http://pastebin.com/t8Qhj8VZ

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @adrian.gabureanu Which compiler do you use?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply
              0
              • jsulmJ jsulm

                @adrian.gabureanu Which compiler do you use?

                A Offline
                A Offline
                adrian.gabureanu
                wrote on last edited by
                #7

                @jsulm MSVC2015 and I'm trying to build for Qt for WinRT 64bit

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved