I have my main program in C++, but now I need to build a beautiful application and I know that WPF is easy and makes for beautiful apps. Can WPF work with C++ or C# and C++? (If yes, how?) Is WPF the best thing for me?
You can use WPF in a managed C++ project, but you're better off keeping your C++ in a separate assembly and referencing it from a C# or VB WPF project.
Yes, you can develop a GUI using WPF framework in Managed C+ or C++/CLI. But they're not Standard C++, hence not cross-platform.
If you just want a GUI for your application written in C++, then you may try Qt as well. The advantage in Qt is that its completely in C++. Not Microsoft Managed C++. The second advantage is that its cross-platform toolkit. That means, you can run your app in Windows, Linux, Mac, and on other machines as well.
Have a look at its documentation
Qt Reference Documentation
It has lots of tools for fast development such as Qt Creator, Qt Designer and others. You can see all of them by browsing the above link.
WPF is dead along with Silverlight, remember, MS says its HTML5 only from now on :)
Using WPF in your C++ app can be achieved using hwndSource, but its not the optimal solution, for that you will have to create C# or VB.NET GUI app, and use it to communicate with your C++ app via some form of IPC.
There are alternatives, probably the best one is to write your GUI using Qt, which is very well respected. You can get similar features to WPF by writing using QML alongside the old forms-based system (which means you get all the development speed of using the old, boring text boxes and the like, and the fancy GUI benefits of using the new declarative UI system, all in the same system. sweet).
Of course, a decent option is to make your app into a back-end server process and call it from a web-server based HTML5 UI. That's pretty future proof, easy to deploy to clients, and as modern as you're likely to get.
Related
Short story: is there a way to write a desktop application with a GUI in HTML5 and core in a cross-platform language like python (or even C#/Mono)?
Longer story: I'm a C# developer, for small personal projects I seldom do, running both under Windows and OSX, I use C# (Mono) with a frontend leveraging on Eto.Forms
I'd like to understand if there's a mature way to achieve the same results using an HTML5 GUI, since I'd like to learn that and believe it could be a good option for near-future Windows desktop UIs (or otherwise a nice tool to have in my skillset). Of course if the code running behind the scenes is C# I'll be more than happy, but also getting my feet wet in another, maybe more cross-platform like python would be good.
At this stage I'm not interested in any mobile-oriented solution.
Electron (formerly Atom shell) has really matured as of late. In fact it's what VSCode is built on.
There's a great tutorial and starter code on using Angular 2 and Typescript, and you can even use VSCode to write and build it.
For me this is the best way to transition from the WPF world to HTML5.
the NW.js look pretty promising... you might even be able to use TypeScript which would be much closer to C# than plain ol' js. If you're open to using PHP, you can check out the nightrain project https://github.com/naetech/nightrain.
Give http://www.tidesdk.org/ a try.
Your app will run on Windows 8, MacOS and Linux. You can use HTML5, Javascript and CSS3.
But you can also extend the functionality of your app with a scripting language you are comfortable with. TideSDK currently supports Python, PHP, and Ruby.
I have recently worked with Chromium Embedded Framework, basically a browser component for WPF an WinForms. It works very well and provides kind of a two-way interoperability from website to .NET-app and vice versa. Basically, you:
Create a WPF desktop app
Include CEFSharp and place a full-screen browser on the window
Call methods in JavaScript:
// .NET
var mainFrame = browser.GetMainFrame();
mainFrame.ExecuteJavaScriptAsync("any js code");
Bind a .NET-object
// .NET
browser.RegisterJsObject("boundObject", this);
Call methods on a bound .NET-object from the website/JS:
// JS
boundObject.someMethod();
On this basis you could build a mediation layer (ViewModels, controllers, ...) between HTML/JS-UI and .NET logic...
I wrote an APP with http://kivy.org/ it is capable to create apps for different systems.
Qt node https://github.com/arturadib/node-qt seems also interesting, but i did not test it myself.
And last https://chrome.google.com/webstore/launcher
You can create web apps for chrome, which should run in supported systems.
Kivy is a Python solution. Qt node is maybe what you are looking for.
Here are some nice tutorials for kivy:
https://www.youtube.com/playlist?list=PLQVvvaa0QuDe_l6XiJ40yGTEqIKugAdTy
NW.js
But it's Javascript (node), not python nor C#.
A very interesting project I think is Chromium Embedded Framework. You basically embed a (stripped down) web browser in your application. For python, many GUI Toolkits are supported. Check this for more information.
Since you are used to C#, maybe Java with JavaFX and FXML is an option. FXML is not HTML but you can style it with CSS as well. You can also use Scene Builder with it for faster UI creation. Many JVM languages support this toolkit so Jython instead of Java will also work. I will recommend Java however, because the support for other languages, while there, is not perfect yet.
Using C# and the Windows App Store WebView is also an option. You can check MSDN for more information.
I am sure there are other options (Kivy, Node.js, etc.) as well. Some of them are already mentioned in this thread.
I would recommend Node-Webkit which is based on nodejs.You can still use some python scripts to do some backend job integrated with Node-Webkit which is easy to deal with.I've already saw some successful applications using this(like wunderlist).TideSDK is another choice but the python support in TideSDK is not mature enough.The Node-Webkit project hosted at
https://github.com/nwjs/nw.js/
I will be developing an interactive application, involving multitouch, several layers of large bitmaps, and video playback. The screen resolution will be fairly large (1920x1280).
For several years, I have developed interactives in Flash, iOS, and OS X Cocoa. However, this project must run on a Windows box, so iOS & Cocoa are impossible. Also, I'm concerned about performance in Flash, since there may be 3 videos playing simultaneously, and large bitmaps moving around.
I know little about the technologies available on Windows. I'm investigating Silverlight, C#, Unity, Processing, and Java. If anyone can offer advice, it will be greatly appreciated.
You seem to be investigating several technologies on different levels:
C# and Java are programming languages. What you prefer may depend on your existing skills, but C# is from Microsoft so chances are that you will experience less friction using this language if you develop for Windows. Picking the right programming language is an important decision.
Silverlight is a "technology stack" from Microsoft. It enables you to develop XAML based applications that run in the browser. Compared to the native WPF stack it is less powerful. Choosing Silverlight, WPF or another technology stack like Processing.js is an important decision.
Unity is a dependency injection container from Microsoft. You can use this or any other suitable container if you like. Or none at all. You don't really have to think about this until you have made some of the more important decisions about your project.
Personally, I don't have experience with the type of application you describe, but I would go with C# and WPF. WPF has some support for multitouch on Windows, and only if it isn't adequate for your requirements you need to to go native and develop in say C++ which tends to require more work.
Multitouch in Windows 8 has been redesigned but unless you want to develop for a yet to be release operating system this is not an option.
Use Visual C++ if you like to create a LAN based Application, C++ is known for it's power and you could have many resources that could help you in developing this application. If you're going to create this application for web Use ASP.net(C#) C# is known for its flexibility and class libraries dedicated for web and client appilcation i also advice the use of WPF and Silverlight applications.
I suggest you have a look at Windows 8 and Metro Apps. Here is a link to start with this: The Microsoft BUILD conference, Windows 8, and the new UX Challenge. C# (.NET languages in fact), HTML5 and XAML are clearly the direction. Native C++ is back in town with WinRT. Silverlight is now in the gray area :-)
Even if you don't use Windows 8, it will give you a good overview of multitouch future in the Windows space.
I want to make an application for my phone (Nokia N900) It uses the Maemo Platform, which is a Linux variant. Most applications are made with either QT or Python, i only have experience in C#, and am wondering if it is at all possible to convert C# to QT, or would i have to use something like Mono or Vala to write the code in C# and create the applications for the N900??
Cheers,
Brendan
About "converting C# to Qt": they're not comparable: C# is a language, while Qt is a UI framework.
Mono does run on Maemo and while there are Qt bindings for .Net/Mono, Mono uses Gtk# as the default/recommended/supported UI framework.
If you are already confident with C#/programming in general, then it should not be too much trouble to pick up a new set of tools. One size does not always fit all!
I do not think that exist a tool for convert C# code to the equivalent Qt/C++, Qt/Python, is something that is best done manually. It's best developed on a platform like a Mono for the N900 or find someone with knowledgeable in Qt able to carry out the work.
Note that Qt is the default platform for Nokia, if you want to install this application on other devices easily best using Qt.
C# as a programming language is controlled by Microsoft. While Microsoft has stated that they will provide a "patent convenant" regarding C#, it is hard to believe them since they have been so eager to sue in the past. ;)
If you want to "convert" your C# app, you'll need to incorporate it into Mono. Mono is a 'cross-platform, opensource .NET development framework." http://www.mono-project.com/Main_Page
Once you've got your app working in Mono, you'll need to interface into Maemo. There are a couple of routes to do this, but Qt is the most likely one to choose. It might be so much work to port your app to Qt that you decide to re-write it, fortunately Qt supports a number of programming languages so you may be able to find something similar to Mono if not Mono and C# itself.
I have to develop a plug-in for an external program using C#.
I am an experienced Qt/C++ programmer and the core of the plug-in is programmed in C++.
My first idea was to program GUI in C#, which write settings to a text file and then call the core C++ code, as an external process, with this textfile as an input.
However I also noticed that there is something called the QAxServer Module in Qt that should make it possible to run Qt/C++ GUI code from C# (trough ActiveX).
I experimented a bit with this and it seemed a bit "shaky".
Do you have any experiences with this you could share?
I would look at writing a C++/CLI (i.e. Managed C++) shim to launch your plug-in and be the bridge between it and the main application.
This will allow you to call into (or be called from) the C# application on one side and talk native C++ on the other.
http://techbase.kde.org/Development/Languages/Qyoto
Qyoto seems to be the most active Qt binding for .NET.
There is also the "QT for .NET" project.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a C++/Java developer and have no idea about .Net or GUIs. I need to develop a windows app for 2000/XP/Vista/7.
I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend? Which GUI approach should I learn? (Forms? Any other stuff?)
Is it the best way to compile in .Net 2.0 mode? It's going to be an application for the public to download.
For desktop applications there are basically two options; WinForms and Windows Presentation Foundation (WPF).
WinForms is more traditionally built and hence easier to learn. WinForms might therefore be a simpler start, but if you plan on actually using your gained knowledge in GUI development for .NET I'd say you're better of diving into WPF from the start. It's a much richer framework, and where Microsoft is putting their effort for desktop applications. It is also similar to Silverlight, meaning you can easily get into Silverlight too when you know WPF.
This other question gives some useful resources when getting started with WPF.
Also check out this tutorial at MSDN.
WpfTutorial obviously has a few nice hints for you too!
Good luck!
In my personal development experience Windows Forms is just about as easy as it gets when it comes to rapidly deploying a GUI application on Windows. WPF is of course another option, but using it would likely require you spend some time familiarizing yourself with XAML. Windows Forms look and feel like a lot of the available GUI options for Java, it's just much better than the majority of them, in my opinion.
If you want the fastest possible GUI development time in .NET, Windows Forms is it.
Yes. C# is the language of choice when it comes to .NET development. Since you've programmed in Java, you'll find that the language looks very familiar (it looks a bit cleaner though and has some very nice features like delegates and you can even use pointers if you really want to, although you won't need to in most circumstances).
It's SWF (System Windows Forms) or MWF (Managed Windows Forms - a lightweight version of SWF written in managed Code using System.Drawing - it frees you from the WinAPI that's underlying classical SWF) all the way.
There's also GTK-Sharp, a GTK+ binding for C-Sharp, but since you're developing for Windows, users will find it strange to install a third-party GUI framework for your application.
I wouldn't recommend using WPF though. It makes direct calls to the underlying graphics hardware, which means it's quite fast, but not portable at all. It will only run on x86 systems (not SPARC, etc.) with DirectX compliant hardware rendering units (graphics cards) and it will not run on a system with strong hardware abstraction (like most Unices like BSD or Linux or Solaris).
Novell also stated that they will never implement WPF in the near future due to it's strong hardware dependencies (Novell wants Mono to be portable across many processor platforms). Don't use WPF. Software is no longer just a throw-away-product and when it comes to operating systems we're in the age of spin. The platform you're running today isn't necessarily the platform you're gonna run tomorrow. WPF is a proprietary and patent-encumbered technology developed by Microsoft and Intel. If you use it, you'll find yourself in a very nice Win32-on-x86 vendor lock in. And this means that you'll most definitely find yourself completely re-writing your application sooner or later. Just write portable software from the beginning, even if you don't need that portability today. I'm telling you from experience, you will need portability tomorrow. Definitely!
You could use Windows Forms or Windows Presentation Foundation to develop your GUI; although, Windows Forms might feel more familiar to you. If you search on Google for Windows Forms tutorial, you will get many options for getting started.
If you need to use .NET 2.0, you will be limited to Win Forms. WPF requires .NET 3.5.
I would suggest downloading Microsoft's free Visual Studio Express Edition to use for developemnt. it includes an excellent drag-and-drop GUI design tool.
I would recommend learning Winforms first, then move the WPF. Winforms is easier to learn and get something working quickly. The future however is WPF, so I wouldnt leave that in the dark. I posted some good books and links for GUI development work.
Books
Design of Everyday Things A really good book about design of interfaces. It's not software specific but a must read for GUI designers.
Coding Horror. He recommends a lot of development books on his book list, but these ones are specifically interface-related:
Don't Make Me Think
About Face 3.0
The Inmates Are Running the Asylum
GUI Bloopers
Web Links
Are Confirmation Dialogs Harmful? A blog entry by Guido van Rossum (creator of Python)
GUI Articles A few articles about GUIs by Joel Spolsky (joelonsoftware.com)
Interfaced Systems International Has a lot of resources, especially on their UI References page
User Experience Guidelines for Windows Vista
I disagree with all the WinForms advocates. It's not easier. It may be easier for someone who has traditional experience with GUI programming, but this poster doesn't have that.
WPF has a better design story and the databinding is much, much better than WinForms. You can get up and running on WPF at least as fast as WinForms, and then go much further without running into the limitations that WinForms has. Couple this with the design-time databinding in VS 2010, and I'd say that anyone starting out on GUI development should completely bypass Winforms.
C# WinForms will be the fastest in terms of getting a practical GUI working rapidly. Though if you think on making a complex GUI, with animations, 3D etc, WPF would be better.
You can use CodePlex to find some good working projects to learn from in terms of best practice, both for WinForms and WPF.
You can also look here for some good books on both WPF and WinForms.
C# for sure. Use Winforms for line of business app / classic GUI.
read petzold 'programming windows with c#'
Or just dive in with visual studio. Creating GUI with VS is really easy - you will like it
You will find the langauge transition from java to c# pretty simple (not the gui bit tho)
I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend?
Personally, I would stick with Java. We (meaning OffByZero, the company I co-founded) have released an encrypted text editor called OBZVault, which is written in Java.
We originally wrote it in Linux, and then ported to Mac OS X and Windows. We found that the Windows port provided a perfectly acceptable look & feel - almost (but not exactly) like a native Windows app.
We used InnoSetup to build a native Windows installer, and found that quite good as well.
Bottom line: unless you want to learn a new language & platform, or you have a specific need for functionality provided by a different platform like .NET, stick with Java for your Windows development too. You'll need to learn a Java GUI framework, but then you'd have to learn WPF or WinForms if you switched to .NET anyway.
It may be faster for an experienced .NET developer to build a Windows app in WinForms or WPF, but if you're already well versed in Java I say stick with the tools (language, libraries, IDE) that you know.