Giter VIP home page Giter VIP logo

modern's Introduction

Modern C++ for the Windows Runtime

Modern is a Standard C++ language projection for the Windows Runtime. The Modern compiler produces a header-only library designed to provide Standard C++ developers with first-class access to the modern Windows API.

Update

Modern is now called C++/WinRT and is included in the Windows SDK. Read all about it here.

This historical repository contains the libraries produced by the original Modern compiler for the following targets. Each library contains a set of sample projects to get you started.

10.0.10240.complete

The complete Windows API (Windows.*) for Universal Windows apps based on the 10.0.10240 SDK.

10.0.10240.noxaml

The Windows API (Windows.*) for Universal Windows apps based on the 10.0.10240 SDK excluding the Windows.UI.Xaml namespace. This is a subset of the complete library for apps that don’t require XAML.

8.1.complete

The complete Windows API (Windows.*) for Universal Windows apps based on the 8.1 SDK.

8.1.noxaml

The Windows API (Windows.*) for Universal Windows apps based on the 8.1 SDK excluding the Windows.UI.Xaml namespace. This is a subset of the complete library for apps that don’t require XAML.

modern's People

Contributors

kennykerr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modern's Issues

Implements Class template method "FindInterface" and const

Not sure if this is an issue but I have been working through your new course Windows Runtime Internals on Pluralsight and I grabbed a copy of the implements class template from here to use.

When I compile the standard c++ project in the 'Core Apps in Standard C++' module with the class template I get the following compiler error:

error C2440: 'static_cast': cannot convert from 'const Modern::Implements<ABI::Windows::ApplicationModel::Core::IFrameworkView,ABI::Windows::ApplicationModel::Core::IFrameworkViewSource> *const ' to 'ABI::Windows::ApplicationModel::Core::IFrameworkViewSource *'

When I double click the error it drops me in this function from the class template:

template <typename First, typename ... Rest>
void * FindInterface(GUID const & id) const noexcept
{
    if (id == __uuidof(First))
    {
        return static_cast<First *>(this);
    }
    return FindInterface<Rest ...>(id);
}

If I remove the const from the method the project builds without error.

Allow authoring/custom winmd consumption (publish the Modern compiler).

Currently there is no way of authoring things modularly and/or consuming non-in-box APIs.
This is a bit of a blocker for me, and I otherwise love the idea.

I noticed that you plan to make the compiler consume winmd instead of IDL, but that doesnt seem critical (for most use cases) as it can be worked around using winmdidl.exe. Right?

The Windows 8.1 does'nt compiler

The Windows 8.1 does'nt compiler either under MSVC 2013 or 2013 with toolset set to V120. Errors on c++ features like 'noexcept'. How do set templates for both Win81 and Win10 development.

WRL vs modern relationship

I watched the video and read some articles on the site, but I'm confused how moderncpp can be related/compared to WRL when it comes to implementing my own classes. Is moderncpp supposed to be a replacement or extention to WRL? Can / should someone use them together? Could you please explain?

Project not available

I'm sure this is something simple, but every project is unavailable and unloads.

I'm using VS2015 enterprise release with C++ installed, and the latest W10 SDK.

What am I missing?

sys tray app

Not really an issue, more like a feature request? The tool I am working on is a traditional systray app that currently uses the traditional core win32 function calls and some rather ugly code to read ini files. I'd like to start fresh with this, is there a way to create and register system tray windows with right click menus and such? I looked around but I didn't see any specific documentation dealing with this. Thanks!

async functions

I tried create a chain based on your example:

Windows::Foundation::IAsyncOperation<StorageFile> a = picker.PickSingleFileAsync().Completed([](auto const & sender, AsyncStatus)
            {
                if (StorageFile file = sender.GetResults())
                {
                    MODERN_TRACE(L"%ls\n", file.Name().Buffer());
                }
                else
                {
                    MODERN_TRACE(L"Canceled\n");
                }
            });

there an error with casting variable 'a':Error C2440 'initializing': cannot convert from 'void' to 'Modern::Windows::Foundation::IAsyncOperationModern::Windows::Storage::StorageFile' App app.cpp 58

Also I tried await functions like advised on StackOverflow:

auto dicop = Windows::Devices::Enumeration::DeviceInformation::FindAllAsync();

            dicop.Completed([](auto dicopint, AsyncStatus) 
            {
                auto f = dicopint.GetResults();
                auto name = f.First().Current().Name();
                MessageDialog dialog(name, L"Hello World!");
                dialog.ShowAsync();
            });
            while (dicop.Status() == AsyncStatus::Started)
            {
                try
                {
                    auto mcw = Windows::UI::Core::CoreWindow::GetForCurrentThread();
                    mcw.Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
                }
                catch (Exception& ex)
                {
                    auto a = ex.Result;
                }
            }

(placed like previous code in KeyUp function)
the code under "try" throws E_UNEXPECTED.
CoreWindow returned by "Windows::UI::Core::CoreWindow::GetForCurrentThread();" same as the "window.KeyUp([](CoreWindow const &cw, KeyEventArgs const & args)" (from KeyUp calling).

Am I wrong using this?

Also where exceptions from namespace Platform (like, AccessDeniedException, COMException etc)? Is there for now only one of them - base (Modern::Exception)?

'Modern::ABI::Windows::Foundation::IReference<Modern::String>': no GUID has been associated with this object

When trying to register a call back for a property change on a Text/Modern::String, I'm unable to get the value of the string. when I ran it to see the runtime class I got "Windows::Foundation::IReference'1"

        text.RegisterPropertyChangedCallback(text.TextProperty(), [](const DependencyObject& d, const DependencyProperty& p) 
        {
            const auto text_prop = d.GetValue(p);
            //text_prop.GetRuntimeClassName() = Windows::Foundation::IReference'1<String>
            const auto text_ref = text_prop.As<Windows::Foundation::IReference<String>>();
        });

The line with text_ref is giving me the compile error.
'Modern::ABI::Windows::Foundation::IReferenceModern::String': no GUID has been associated with this object

Modern::Windows::UI::Xaml::Controls::Button - No Base of UIElement

void Modern::Windows::Foundation::Collections::impl_IVectorModern::Windows::Foundation::Collections::IVectorModern::Windows::UI::Xaml::UIElement,T::Append(const T &) const': cannot convert argument 1 from 'Modern::Windows::UI::Xaml::Controls::Button' to 'const Modern::Windows::UI::Xaml::UIElement &'

I can't bind it to a context as well.

No SAL?

I've noticed (at least, in part of the code) that there's very little SAL in modern.... what's up with that?

Especially in COM-related code, I never cease to be amazed by how powerful SAL is, and I believe that it's indescribably valuable for any library code!

Side note: Does modern support VS2013? I haven't yet got my hands on 2015, and'd happily add the SAL myself.

Composition sample does'nt work anymore on Windows 10

I get interface not found for "ICompositor". The "Compositor" constructor fails in SetWindow

void SetWindow(CoreWindow const & window)
{
Compositor compositor;
ContainerVisual root = compositor.CreateContainerVisual();
....

Internal includes - forward slashes?

Any way you can modify the generator tool to use forward slashes in the include statements? MSVC handles them fine, and then it increases the likelihood that other compilers and compilers hosted on other platforms can actually build the code.

filesystem

Now I`m working on app that read files and parse it. I try port my code into your CoreApp sample.
First of all, app.cpp: code after line "CoreApplication::Run(make());" unreachable. I set after it "auto a=0" and set breakpoint - app never reaches this point.
Second - I try to use "Windows::Storage::Pickers::FileOpenPicker". Usually it needs to set "ViewMode" prop. So following code:
auto picker = Windows::Storage::Pickers::FileOpenPicker();
picker.FileTypeFilter.ViewMode = Windows::Storage::Pickers::PickerViewMode::List;
generates error c2228 (which is currently missing on msdn). It said "left of ViewMode must be a class, struct...". Also I unable set FileTypeFilter prop - member of it "Append" is missing. Assume that this prop
is Foundation::Vector<String^>

2015-08-28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.