开发者

Cross-platform support for various MFC\ATL classes

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜