版权所有 2009-2015 荆门泽优软件有限公司

保留所有权利

产品首页:http://www.ncmem.com/apps/xproerui/index.asp

开发文档(SkinStudio):为图片添加九宫格信息为窗体设置背景图片添加图片按钮共用字体属性控件的相对位置与绝对位置

升级日志:http://www.cnblogs.com/xproer/archive/2010/12/04/1896399.html

资源下载(360云盘):boost-1.55.0-src(提取码:9d60),boost-1.55.0-lib(VC100)(提取码:ef58),zlib-1.2.8-src(提取码:6ebe),pugxml-1.4-src(提取码:4858),CxImage-src(提取码:4e39),

资源下载(百度网盘):boost-1.55.0-src,boost-1.55.0-lib,zlib-1.2.8-src,pugxml-1.4-src,CxImage-src,

资源下载-WTL(360云盘):XproerUI库(提取码 61ca),XproerUI开发文档(提取码 85f1),

资源下载-MFC(360云盘):XproerUI库(提取码 a25a),XproerUI开发文档(提取码 06ba),

联系邮箱:1085617561@qq.com

联系QQ:1085617561

 

项目类型:WTL

主要步骤如下:

1.下载库头文件和库lib文件。

2.在项目中配置库头文件路径和链接器文件路径。

 

XproerUI结构:

3rd                    第三方库目录

  cximage

    dll                编译的DLL目录

  pugixml-1.4         

    lib                编译的LIB目录

  zlib-1.2.8

    dll                编译的DLL目录

XproerUI               UI引擎库目录

  dll                  编译的DLL目录

  Resource

  Xproer.Com

  Xproer.Drawing

  Xproer.Forms

  Xproer.Manager

  Xproer.UI

  Xproer.UI.Controls

  Xproer.UI.WinControls

 

1.1.1.    下载相关资源

boost-1.55.0-src:官网,360云盘(提取码 9d60),百度网盘,

boost-1.55.0-lib(VC100):360云盘(提取码 ef58),百度网盘,

zlib-1.2.8-src:360云盘(提取码 6ebe),百度网盘,

zlib-1.2.8-dll(VC100) :360云盘(提取码 25c3),百度网盘,

pugxml-1.4-src:360云盘(提取码 4858),百度网盘,

pugxml-1.4-lib(VC100):360云盘(提取码 ce29),

CxImage-src:360云盘(提取码 4e39),

CxImage-dll(VC100):360云盘(提取码 4785),

WTL80-src:360云盘(提取码 8989),

WTL81_12085-src:360云盘(提取码 09e1),

WTL90_4140_Final-src:360云盘(提取码 dd76),

XproerUI:360云盘(提取码 61ca),百度网盘,

 

1.1.2.    设置头文件路径和链接库路径

说明:建议将项目文件夹和XproerUI放在同级目录下

示例结构:

3rd           第三方库目录

AppUI         XproerUI库目录

AppUtils      Xproer工具库目录

demo          自已的工程目录

 

使用上面的目录结构可以直接使用下面的头文件和链接库配置代码(在Debug和Release模式下通用):

头文件:

.\

..\3rd\pugixml-1.4\src

..\3rd\cximage\CxImage

..\3rd\zlib-1.2.8

..\AppUtils

合并:

.\;..\3rd\pugixml-1.4\src;..\3rd\cximage\CxImage;..\3rd\zlib-1.2.8;..\AppUtils;

 

链接库(MD):

..\3rd\pugixml-1.4\lib\$(ConfigurationName)\

..\3rd\cximage\dll\Unicode $(ConfigurationName)\

..\3rd\zlib-1.2.8\dll\$(ConfigurationName)\

..\AppUtils\

%(AdditionalLibraryDirectories)

合并:

..\3rd\pugixml-1.4\lib\$(ConfigurationName)\;..\3rd\cximage\dll\Unicode $(ConfigurationName)\;..\3rd\zlib-1.2.8\dll\$(ConfigurationName)\;..\AppUtils\dll\$(ConfigurationName)\;%(AdditionalLibraryDirectories)

 

附加包含目录截图:

 

链接器配置截图:

 

1.1.3.    在项目的stdafx.h中增加头文件

XproerUI提供了UIHead.h文件,在项目中只需要包含此文件即可。

// stdafx.h : include file for standard system include files,

//  or project specific include files that are used frequently, but

//  are changed infrequently

//

 

#pragma once

 

// Change these values to use different versions

#define WINVER         0x0500

#define _WIN32_WINNT   0x0501

#define _WIN32_IE  0x0501

#define _RICHEDIT_VER  0x0500

 

//包含UIHead.h文件

#include "UIHead.h"

 

extern CAppModule _Module;

 

 

#if defined _M_IX86

  #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")

#elif defined _M_IA64

  #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")

#elif defined _M_X64

  #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")

#else

  #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

#endif

说明:在UIHead.h中自动包含了boost,AppUtils,XproerUI.lib,zlib,cximage,pugixml等文件和lib

UIHead.h文件代码如下:

#pragma warning(disable:4150) //

#pragma warning(disable:4251) //

#pragma warning(disable:4275) //

 

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 某些 CString 构造函数将是显式的

#define _WTL_NO_CSTRING

#define _WTL_NO_WTYPES

 

#include <atlbase.h>

#include <atlstr.h>

#include <atltypes.h>

#include <atlapp.h>

#include <atlctrls.h>

#include <atlcrack.h>

#include <atldlgs.h>

#include <atlframe.h>

#include <atlwin.h>

#include <atlmisc.h>

#include <atlcom.h>

#include <atlctl.h>

#include "atltime.h"

#include <atlhost.h>

#include <GdiPlus.h>

#include "Richole.h"

#include "Richedit.h"

#include "shellapi.h"

#include "Usp10.h"

using namespace Gdiplus;

 

#include <vector>

#include <map>

#include <list>

#include <algorithm>

#include <memory>

#include <fstream>

#include <string>

#include <functional>

using namespace std;

 

#include <boost/foreach.hpp>

#include <boost/typeof/typeof.hpp>

#include <boost/smart_ptr.hpp>

#include <boost/any.hpp>

#include <boost/variant.hpp>

#include <boost/bimap.hpp>

#include <boost/filesystem.hpp>

#include <boost/format.hpp>

#include <boost/assert.hpp>

#include <boost/assign.hpp>

#include <boost/algorithm/string.hpp>

#include <boost/pool/detail/singleton.hpp>

#include <boost/date_time/gregorian/gregorian.hpp>

#include <boost/date_time/posix_time/posix_time.hpp>

#define BOOST_ALL_NO_LIB

#define BOOST_DATE_TIME_SOURCE

#define foreach BOOST_FOREACH

#define reverse_foreach BOOST_REVERSE_FOREACH

using namespace boost;

using namespace boost::assign;

using namespace boost::gregorian;

using namespace boost::posix_time;

using namespace boost::filesystem;

namespace fs = boost::filesystem;

using boost::details::pool::singleton_default;

 

#include "ximage.h"

#include "sigslot.h"

#include "pugiconfig.hpp"

#include "pugixml.hpp"

#include "contrib/minizip/zip.h"

#include "contrib/minizip/unzip.h"

using namespace pugi;

 

#include "sigslot.h"

#include "AppUICfg.h"

#include "AppUtilsCfg.h"

#include "Resource/IResource.h"

#include "Xproer.Drawing/GdiTool.h"

#include "Xproer.Drawing/CxImageTool.h"

#include "Xproer.Drawing/CombinImage.h"

#include "Xproer.Drawing/CombinImageX.h"

#include "Xproer.Drawing/TileImage.h"

#include "Xproer.Drawing/TileImageX.h"

#include "xproer.Manager/ResMgr.h"

#include "Xproer.Manager/ColorMgr.h"

#include "xproer.Manager/FontMgr.h"

#include "xproer.Manager/ImageMgr.h"

#include "xproer.Manager/PopMenuMgr.h"

#include "Xproer.Manager/StyleManager.h"

#include "xproer.Manager/ImageCfg.h"

#include "Xproer.UI/ArgsManager.h"

#include "Xproer.UI/Styles.h"

#include "Xproer.UI/IDSigner.h"

#include "Xproer.UI/DUIControl.h"

#include "Xproer.UI/AppUI.h"

#include "Utility/Encoder.h"

#include "Utility/Convert.h"

#include "IO/Directory.h"

#include "System/Screen.h"

using namespace Xproer::Manager;

using namespace Xproer::UI;

using namespace Xproer::System;

using namespace Xproer::Drawing;

using namespace AppUtils::Utility;

 

#pragma comment(lib, "Usp10.lib")

#pragma comment(lib, "cximage.lib")

#pragma comment(lib, "gdiplus.lib")

#pragma comment(lib, "pugixml.lib")

#pragma comment(lib, "zlib.lib")

#pragma comment(lib, "AppUtils.lib")

#pragma comment(lib, "XproerUI.lib")

#ifdef _DEBUG 

#pragma comment(lib, "libboost_date_time-vc100-mt-1_55.lib")

#pragma comment(lib, "libboost_system-vc100-mt-gd-1_55.lib")

#pragma comment(lib, "libboost_filesystem-vc100-mt-gd-1_55.lib")

#else

#pragma comment(lib, "libboost_date_time-vc100-mt-1_55.lib")

#pragma comment(lib, "libboost_system-vc100-mt-1_55.lib")

#pragma comment(lib, "libboost_filesystem-vc100-mt-1_55.lib")

#endif

 

2.将项目运行库改为MD

 

修改Release模式的运行库:

 

1.1.4.    在_tWinMain中初始化UI库

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)

{

     //加载RichEditor.dll

     HRESULT hRes = ::CoInitialize(NULL);

     HMODULE hMod = ::LoadLibrary(CRichEditCtrl::GetLibraryName());

 

     ATLASSERT(SUCCEEDED(hRes));

 

     // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used

     ::DefWindowProc(NULL, 0, 0, 0L);

 

     //初始化GDI+

     GdiplusStartupInput gdiplusStartupInput;

     ULONG_PTR gdiplusToken;

     GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

 

     AtlInitCommonControls(ICC_BAR_CLASSES);   // add flags to support other controls

 

     hRes = _Module.Init(NULL, hInstance);

     ATLASSERT(SUCCEEDED(hRes));

 

     AtlAxWinInit();

 

     //初始化UI库

     LoadTheme(L"Theme.skn");

 

     int nRet = Run(lpstrCmdLine, nCmdShow);

 

     _Module.Term();

 

     //卸载UI库

     UnLoadTheme();;

     //卸载GDI+

     GdiplusShutdown(gdiplusToken);

     //释放CRichEdit动态链接库

     if(NULL != hMod) ::FreeLibrary(hMod);

     ::CoUninitialize();

 

     return nRet;

}

 

1.1.5.    修改主窗口代码

1.继承DialogBase,将将消息转发给DialogBase处理

// MainDlg.h : interface of the CMainDlg class

//

 

#pragma once

#include "xproer.Forms/DialogBase.h"

using namespace Xproer::Forms;

 

class CMainDlg

: public CAxDialogImpl<CMainDlg>

, public DialogBase

{

public:

     enum { IDD = IDD_MAINDLG };

 

     BEGIN_MSG_MAP(CMainDlg)

         MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)

         COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)

         COMMAND_ID_HANDLER(IDOK, OnOK)

         COMMAND_ID_HANDLER(IDCANCEL, OnCancel)

         CHAIN_MSG_MAP(DialogBase)//转发消息

     END_MSG_MAP()

 

// Handler prototypes (uncomment arguments if needed):

//   LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)

//   LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)

//   LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

 

     LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);

     LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

     LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

     LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

};

 

2.在OnInitDialog中设置关联的配置文件

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)

{

     this->AttachDlg(this->m_hWnd, L"360yunpan.xml");//设置关联的界面信息

 

     CenterWindow();

    

     // set icons

     HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));

     SetIcon(hIcon, TRUE);

     HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));

     SetIcon(hIconSmall, FALSE);

 

     return TRUE;

}

如何使用XproerUI库(WTL)-XproerUI界面库教程的更多相关文章

  1. UILite-MFC/WTL/DirectUI界面库

    之前写了UILite库介绍: http://blog.csdn.net/zhangzq86/article/details/9093945 如今UILite库能够使用git訪问了: https://g ...

  2. 几款国产开源的Windows界面库

    上次介绍的几款图形界面库http://blog.okbase.net/vchelp/archive/23.html都是国外的开源项目,今天介绍的几款都是国人的开源项目,大部分是采用DirectUI设计 ...

  3. C++界面库

    刚开始用C++做界面的时候,根本不知道怎么用简陋的MFC控件做出比较美观的界面,后来就开始逐渐接触到BCG  Xtreme ToolkitPro v15.0.1,Skin++,等界面库,以及一些网友自 ...

  4. 开源.NET界面库

    一.十大开源的.NET用户界面框架 选择一款合适的GUI框架是.NET开发中比较重要但又很棘手的问题,因为用户界面相当于一款应用的"门面",直接面向用户.好的UI更能吸引用户,有时 ...

  5. C++界面库(十几种,很全)

    刚开始用C++做界面的时候,根本不知道怎么用简陋的MFC控件做出比较美观的界面,后来就开始逐渐接触到BCG  Xtreme ToolkitPro v15.0.1,Skin++,等界面库,以及一些网友自 ...

  6. C++100款开源界面库[转]

    (声明:Alberl以后说到开源库,一般都是指著名的.或者不著名但维护至少3年以上的.那些把代码一扔就没下文的,Alberl不称之为开源库,只称为开源代码.这里并不是贬低,像Alberl前面那个系列的 ...

  7. C++ 100款开源界面库 (10)

    (声明:Alberl以后说到开源库,一般都是指著名的.或者不著名但维护至少3年以上的.那些把代码一扔就没下文的,Alberl不称之为开源库,只称为开源代码.这里并不是贬低,像Alberl前面那个系列的 ...

  8. 仿迅雷播放器教程 -- C++ 100款开源界面库 (10)

      (声明:Alberl以后说到开源库,一般都是指著名的.或者不著名但维护至少3年以上的.那些把代码一扔就没下文的,Alberl不称之为开源库,只称为开源代码.这里并不是贬低,像Alberl前面那个系 ...

  9. 仿迅雷播放器教程 -- C++ windows界面库对比(11)

    从上一篇文章中可以看出,C++的界面方向还很弱,没有任何一个界面库可以一统天下,所以才造成了界面库百家争鸣的情况. 从时间上看: 1.出来最早的是QT,1991年就有了. 2.VC++ 虽然1992年 ...

随机推荐

  1. tensorflow4

    参考:tensorflow_manual_cn.pdf 一.图像的四维张量和参数的四维张量貌似不同: 二.流程回顾 1.数据准备 2.Page 63 三.状态可视化 四.保存检查点(保存参数) 五.评 ...

  2. 网页左上角图标 favicon.ico

    显示网页左上角标志图标 <link rel="shortcut icon" type="image/x-icon" href="images/f ...

  3. Win7重装后,如何删除cygwin目录?

    参考: http://blog.csdn.net/zjjyliuweijie/article/details/6577037 http://blog.csdn.net/huangzhtao/artic ...

  4. MSSQL 和 REDIS的数据类型对应关系

    when user_type_id in (34) then 'BLOB' --image            when user_type_id in (35) then 'CLOB' --tex ...

  5. oracle 左边填充函数使用

    左边填充 select lpad('abcde',10,'0') from dual; ==>00000abcde select lpad('abcde',10,'x') from dual;= ...

  6. Debian系统常用配置

    每一次安装Linux之后总需要设置一下系统,下面把常用的设置总结一下,方便以后使用: 1.系统安装包选择 每一次找Linux的安装包时,总会纠结一下选哪个好,我在这里总结一下:安装Debian选择对应 ...

  7. 基于KO+bootstrap+MVC的分页控件

    JS: /// <reference path="../knockout-3.2.0.js" /> var ViewModel = function (data) { ...

  8. WCF JSON DATETIME JSON.NET (Newtonsoft.Json.dll)

    [DataMember] public DateTime? myTime { get; set; } var timeFormat = new JsonSerializerSettings() { D ...

  9. 基于adt-bundle-windows-x86的android开发环境搭建

    0,简介: 最近简单着手了解 android 开发.工欲善其事,必先利其器. 我本人不太喜欢使用java 开发,所以简单了解了下其 c# c++都可以进行android 开发,用c++的话要使用NDK ...

  10. FileUploadInterceptor拦截器的笔记

    当请求表单中包含一个文件file,FileUploadInterception拦截器会自动应用于这个文件. 表单: <s:form namespace="/xxx" acti ...