I am interested in using Javafx for my visual content for a desktop application and call native,unmanaged C++ functions ( on events from the Javafx views). Is this possible? Can someone explain with an example?
As JavaFX has been designed for maximal compatibility with the Java platform, you can always call Java code from your JavaFX code, and then do some JNI stuff, as in this example question.
Related
I was wondering either it is possible to run an external application inside a QT widget under windows operating system. For example, if I were to write a Qt gui application, where in one of the dialogs user could write some text, I could use a textbox there or something similar. But instead, would it be possible to run Notepad++ or windows notepad application in that dialog?
I would appreciate all help.
It is not really practical to do what you describe at the application level, embedding an entire process into a window of another. (It would be technically difficult and the user experience would likely be pretty bad if you could pull it off.)
Fortunately, this very problem of application components has already been solved!
So it is possible to get the end result you describe via a slightly different mechanism. Many applications expose COM interfaces for automation and embedding, and it is possible to embed COM objects within a Qt application.
(Older technologies such as DDE, OLE and ActiveX provided various aspects of this but are all basically deprecated in favour of COM AFAIK.)
Hopefully you can find a COM object from a third party, or find an app that exposes its components via COM and assemble your app that way.
Have a look at the Qt documentation:
Active Qt - ActiveX and COM support for Qt
Can I integrate Flurry into DirectX (no C# code) WP8 app?
Flurry docs have some instructions, but they are for C# app. I have a FlurryWP8SDK.dll and I don't know is it possible to integrate it into my project.
Unless Flurry comes out with a C++ SDK you can't integrate Flurry in a pure Direct3D app. You could however use the Direct3D with XAML app template. http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714079(v=vs.105).aspx
You will still get good Direct3D performance, and will have most of your code in the C++ WinRT component. Having the C# layer will allow you to integrate Flurry, and you can pass down delegate functions from the C# into your WinRT component so that your C++ code can log events with Flurry.
Edit: I wrote a blog post about this topic with some code examples - http://robwirving.com/2014/07/21/calling-c-methods-c-winrt-components/
So I look at this (Windows build keynote 1:42:56) And I just do not get it - what I can use to create GUI from C++ and/or GUI language that will be capable to call functions from my C++ code? HTML, XAML or what? And where to see code sample of doing markup call code and code create GUI sample with C++ for Windows 8 Metro apps?
Sample code in C++ and other languages is at http://code.msdn.microsoft.com/windowsapps. You can take a look at how it's done.
If you want to call C++ code the easiest way will be to use C++ with Component Extensions. This is just plain C++ that compiles to native code however it has a few extensions (reminiscent of C++/CLI) that let you use the WinRT COM components without worrying quite so much about the COM plumbing.
With C++ and WinRT you can actually use XAML like the managed languages to define your user interface. It's pretty neat, see the documentation here:
Information on C++ component extensions
I haven't looked into it but you may still be able to use P/Invoke or COM interop in the managed languages to call C++ code for a Metro style app however this is unconfirmed. Obviously a desktop app can do all the things it normally would.
You can use C++ code to write metro style applications. You can also write applications in Javascript/HTML/CSS and call APIs that you write in C++ or C#/VB from those JavaScript applications.
How can i make buttons in c++ and handle them.
I am targeting win32.
Till now i have no idea of how to make graphical programs in c++ . I have come from JAVA and therefore have no idea of handling c++ events and building GUI
It will be of great help if you give the links to tutorials or could name the books to do so.
C++ is merely a language and the framework and operating system services whcih enables you to make use of the services using C++.
Java contains a GUI framework which has implemented across the platform. When you come to a native windows application, you have to rely on mainly two things, Win32 and MFC(a C++ wrapper of Win32 APIs). Win32 provides C based APIs which expose the operating system services.
For your specific questions I can answre like, You can use CreateWindow() Win32 API or CButton::Create() (MFC) to create a button. Also Visual studio provide a really good resource editor where you can manage the controls and make the message handlers.
The APIs are largely classified in to three DLLs
GDI32.dll - provides APIs for drawing
User32.dll - provides APIs to creates buttons windows etc.
Kernel32.dll - provides APIs to use operating system services like file creation, threading, synchronization etc.
As a Java programmer, it would be easy to adopt C# rather than C++. For you C++ might be going back to stone age where you've to hit the stones and make the fire, where in C# you can enjoy the easiness of a matchbox.
I'd suggest you to read following books to learn basic GUI programming under Windows
Windows Via C++ - (Win32)
Programming Windows with MFC - Jeff Prosise
Programming Windows - Charles Petzold
Making UIs is not part of C++ itself : you'll have to use a framework or rely on something else (like MFC in visual c++).
If you want easier way of building a GUI and manage your events, while still keeping your code portable, I suggest having a look at Qt : it's really good quality and delivered with a bunch of well-done examples. (license is LGPL so as long as you link dynamically, you can license your code the way you like).
A very good book to understand win32 api is http://www.charlespetzold.com/pw5/.
Hi
I'm starting windows application development on windows7 with C++. ( or C#/Java if necessary ).
The application in mind right now is a window that has a inner frame (kind like a iframe) displaying a web page in it, and to have the outer and inner frame be able to communicate ( ie. the webpage pass a message to the outer frame, possibly by JavaScript, and the outer frame recognize the message and starts the computer's camera ).
It would be something like this
http://html5demos.com/postmessage2
except that the outer frame is a windows application instead of a webpage.
Preferably, the inner frame displaying the web page is powered by web-kit.
I really don't have much experience so I was wondering if such thing is possible and where to start.
Any advice or resource is welcomed.
Thanks in advance.
I've seen projects use the status bar to communicate with Javascript in an embedded browser.
RichHtml4Eclipse is such a project ; while no longer in development, it demonstrates the general approach. Events with structured data are raised by changing the status text, which native code on the outside can pick up and deserialize. Javascript methods may be called on the code in the page by using the method calls provided on the browser control.
I would support the comment that encourages you to avoid C++. There are WebKit bindings for both Java and C# ; in my experience, Java has the edge in portability but C# / .NET makes for an easier experience when developing GUI components.
Why don't you take a look at Qt. It is cross-platform, comes with QtCreator - a nice IDE, and can be easily integrated with WebKit (in fact, WebKit is started by KDE, which is based on Qt).
If you're running Windows and aren't concerned with portability, using .NET could much quicker. Perhaps this article would be of some use.