Giter Club home page Giter Club logo

cxx_wpf's Introduction

Exploration of C++ and WPF Integration

The idea of this project was to take a simple Visual C++ 6 MFC application as a starting point and then merge in some WPF / C# elements.

So initially I started with the following projects:

  • VS6/WineService
    • A Visual C++ 6 MFC Extension DLL that exposes a small subset of the entities provided by the wine.com OData service.
  • VS6/WineDemo
    • A Visual C++ 6 MFC Dialog-based application that displays some basic product information in an owner-drawn CListBox.

I then migrated these projects to Visual Studio 2010.

I then added 3 new projects by following these sections in the book "C++/CLI in Action":

  • 5.4 Exposing an MFC extension DLL to .NET
  • 7.4 Hosting a WPF control in a native C++ application

This resulted in the following list of projects:

  • VS2010/WineService
    • Migrated MFC Extension DLL. Still native VC++.
  • VS2010/WineDemo
    • Migrated MFC Dialog-based application. Still native VC++.
  • VS2010/WineServiceShim
    • MFC Regular DLL built with /clr. Exposes managed reference types to C#.
  • VS2010/WineDemoUserControls
    • WPF User Control Library (C#). Houses a user control called WineList that contains a ListView control. This user control replaces the owner-drawn CListBox in the original MFC application. It data binds to the managed types exposed by the WineServiceShim project.
  • VS2010/WineDemoUserControlsWrapper
    • MFC Extension DLL built with /clr. Wraps the WPF WineList user control by hosting it in a HwndSource.

Issues - Resolved

  • VC++ project settings for General | Character Set
    • Need to ensure that all the VC++ projects in the solution use the same value for this setting otherwise I got various nasty problems. I am using the value "Use Multi-Byte Character Set" for all projects.
  • error C3767: 'Product::Product': candidate function(s) not accessible, etc.
    • Needed to use #pragma make_public in WineService.h to resolve these errors

Issues - Unresolved

  • #include via a shortcut
    • I have a shortcut in the lib subdirectory that links to the location of the boost libraries on my machine. In VS6, I can use this shortcut as an additional include directory i.e. "..\lib\boost_1_47_0". However, VS2010 doesn't seem to follow the shortcut.
  • Design-time data (WineList.xaml)
    • I have tried to include some design-time data in my WineListViewModel class but it doesn't show up in the Visual Studio designer.

References:

cxx_wpf's People

Stargazers

Abdullah avatar

Watchers

Jonathan Taylor avatar James Cloos avatar

Forkers

javadiahmad

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.