源码下载包含使用说明:http://download.csdn.net/download/weihuanzhen_yeah_net/5017822
1.配置_XTP_STATICLINK使能静态链接
包含头文件使能静态链接:#define _XTP_STATICLINK
2.包含静态库声明头文件:#include <XTToolkitPro.h>
3.在你工程里的rc2文件中,包含如下语句,否则调用XTP中的资源时会发生异常
#include <XTToolkitPro.rc>
调用函数(自定义)
void My_ui(void) { TCHAR szStylesPath[_MAX_PATH] = {0}; VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szStylesPath, _MAX_PATH)); m_strStylesPath = szStylesPath; int nIndex = m_strStylesPath.ReverseFind(_T('\\')); if (nIndex > 0) { m_strStylesPath = m_strStylesPath.Left(nIndex); } else { m_strStylesPath.Empty(); } m_strStylesPath += _T("\\styles\\"); char szstr[256]; XTPSkinManager()->SetApplyOptions(XTPSkinManager()->GetApplyOptions() | xtpSkinApplyMetrics); //XTPSkinManager()->AddColorFilter(new CXTPSkinManagerColorFilterColorize(50, 100, 1)); #if 1 //读配置文件style.ini的信息加载皮肤 ::GetPrivateProfileString("Skin", "Name", "Vista3.cjstyles", szstr, sizeof(szstr), m_strStylesPath + "style.ini"); XTPSkinManager()->LoadSkin(m_strStylesPath + szstr); #else
//手动加载QQ2004.cjstyles皮肤 XTPSkinManager()->LoadSkin(m_strStylesPath + _T("QQ2004.cjstyles")); #endif }