I'm trying to keep my C++ project cross-platform as much as possible.Albeit I do have dependencies on the following MFC\ATL classes: CString, CTime, CTimeSpan.
Is there an open implementation somewhere of MFC\ATL classes?
How common are these packages and should I use the open source libraries to start with, or should I wait until the need arises?
Instead of CString use std::string
Instead of CTime use boost::ptime
Instead of CTimeSpan use boost::time_duration
While this proposal won't answer your cross platform requirement, it does meet the request for an "open implementation of MFC/ATL classes".
Check out the Windows Template Library(WTL).
Microsoft open sourced it some years ago, you can download it from its sourceforge project page, and it's also available from Microsoft's website somewhere.
The description from the SourceForge page:
Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.
Hope this helps!
I recommend not to rely in those classes. They are specific of MFC/ATL, and won't be easily ported to Unixes, for example. Try to build a separate conversion layer, and try to build around boost libraries, much more portable.
Related
I want to use simple plotting functions in my C++ code. Presently I am using Qt5 with VS2010 c++ compiler. I came across this library called koolplot. But I cannot buid it with VS2010 from its source files. I am opening vs2010 cmd and running nmake...It shows winbgim.h missing..I copied that header in MinGW include folder and ran it ...now it shows "Plotdata.h:warning: 'typedef' was ignored in this declaration" Please help...if any one knows a simple plotting library running with VS2010 please suggest..
According to its website, Koolplot is designed for the MinGW/gcc toolchain - you'll have to do a bit of leg work to get it to compile on Visual Studio, though I don't know specifically what you'd have to do without taking a closer look.
Also, the library seems to do its own window management and the like, so I'm not sure how well you'll be able to integrate it with Qt.
koolplot needs WinBGI library (BGI = Borland Graphics Interface?).
I have changed it to use native Win32 using VS2008:
http://www.tu-chemnitz.de/~heha/hs/koolplot-heha.zip/
It's still incomplete as a good Win32 implementation would implement koolplot in a DLL which self-registers a Window class, and has both C and C++ interface. Moreover, koolplot as-is doesn't support multiple scales, finer plotting options, GDIplus, and fast data update, so it's not the right thing to write an oscilloscope program.
It's C++ code is also outdated as there are lambda functions available now.
However, good integrating into Qt is another task.
Is it possible to use c++ lib inside as3 project? (flash builder 4.7)
I have a project writen in c++ and I want to build the gui with flash.
I'm seracing for a way to use flash and work with my c++ lib
I guess that a Flash GUI is actually some Web interface. Then, you need some HTTP server library in C++, like the Onion library, the network part of Poco libraries, or the Wt library.
BTW, perhaps making a pure HTML5 + Javascript interface is easier and more portable, with the real work done in C++.
Probably not what you are looking for, but you could use FlasCC http://www.adobe.com/devnet-docs/flascc/docs/Reference.html That imposes some requirements on your lib, but I think nothing that #define-s cannot handle )
I'm developing a C++ application that needs a GUI. I would like to use the Windows 7 Ribbon Framework, so I'm not interested in having my app compatible with OS different that windows. I would like to also use my preferred IDE, Visual Studio 2010 and obviously I would like to use standard C++ things like std::string, etc. I saw that there is Qt, it seems cool but as I understand I shoud use it with their own compiler because they provide some things that are not part of the standard c++ (slots keyword for example). Plus, I saw that I can use a QWinHost to host win32 controls but I'm not sure if I can host the ribbon control. Should I implement myself a little library to simply manage native win32 controls or should I go with Qt?
but as I understand I shoud use it with their own compiler
Nope, that's incorrect. You'll use your compiler - be it microsoft compiler, mingw-g++ or something else, as long as it is supported by Qt.
Qt provides their own additional preprocessor, called moc. Moc takes input files and based on their contents produce additional *.cpp files which contains standard c++ code. Those files are in turn fed to your "normal" compiler. All necessary build rules are handled automatically, as long as you use qmake to generate project.
Should I implement myself a little library to simply manage native win32 controls or should I go with Qt?
It is your code, and your decision to make. However, to me writing "little library" sounds a lot like reinventing the wheel. If I were you, I'd first tried to make the control work with Qt - because this way I won't have to reinvent the wheel - there are too many GUI toolkits already, so making another one alone is quite pointless.
I have inherited an old C++ (MFC) project and will have to add new functionality.
The new functionality will mostly not conflict with the existing C++ code, like additional dialogs etc.
Having limited experience with C++ MFC, I would very much prefer to do the additional functionality in Delphi, create a DLL and use the DLL in the C++ project.
I guess this is generally possible, similar to using C++ DLLs in Delphi?
Are there limitations on what can be done this way?
Basically, there are no issues. But if you're going to use dialogs and so on, your application will be using two frameworks, MFC and the VCL, and they may not play very well together.
Delhi if I recall my history should create Dll's happily. See here 'Calling delphi DLL from MS Visual C++' for an example
I'm going to create a utility with GUI that will run on Windows operating systems.
It should require minimum (or zero!) amount of additional libraries, files or DLLs to run because it will be executed from an installer. Because of this, i don't want to use .NET for it will require user to install .NET Framework. I know today, most of Windows installed system come with .NET Framework but in my case i cannot be sure.
The utility will...
send some data to a web site and
parse the returning data,
collect some hardware info, like MAC address,
CPU type and make, hard-disk serial
number
I suppose native Win32 API could be used for all of those above, but instead of hassling with Win32, i'd prefer using a more developer friendly API, or SDK.
Thanks in advance.
Win32 API is the only way, and of course there are standard API - for sending data over the internet, you could use WinInet.lib/dll, to obtain information about the MAC, you could use the GetAdaptersInfo by using Iphlpapi.lib/dll,(here's a link on how to use it) for the Hard disk serial number you could use GetVolumeInformation by using kernel32.lib/dll. For the CPU Id, you might look into GetSystemInfomation
Edit: There's a C++ code, but you can easily derive a wrapper from this site Unfortunately, with WinAPI is not easy, no such thing as RAD with WinAPI but what you gain out of it is lightweight code instead of relying on SDK's, frameworks and dragging buggy dll's around with your application.
Hope this helps,
Best regards,
Tom.
You can statically link most C++ GUI libraries - even MFC. Personally, I recommend WTL, wihich is very light and header-only.
If what you want is minimum dependency with external files or DLLs you could statically compile all the required DLLs with the tool exe. Then you could use something like Visual C++ to develop such tool.
WTL is perfect for this sort of application and I am surprised more people aren't recommending it. You can also statically link with the CRT and hey presto - no dependencies and a very small EXE.
Delphi (now by Embarcadero) would do the job, creating a .exe file with no dependencies, and it is much easier to work with than the raw Win32 API.
If you don't like Object Pascal, you could try C++ Builder instead.
For the GUI you can either build your application with MFC (statically linked) or use a HTML based dialog that you can interact with using COM. (It is even possible to interact with javascript present in the page displayed by the dialog).
For the specific requirement that you do have, I feel Win32 API is the only way out.
Use MFC and statically link to it. No runtime dependancies need to be installed.