VC取程序版本信息
来源:互联网 发布:windows网络编程书籍 编辑:程序博客网 时间:2024/05/29 15:17
int Data::VersionConvert(DWORD high,DWORD low)
{
int r= 0;
r+= high>>16;
r<<=4;
r+=high&0x0000ffff;
r<<=4;
r+=low>>16;
r<<=4;
r+=low&0x0000ffff;
return r;
}
int Data::VersionConvert(CString v)
{
int r=0;
try
{
if(v.GetLength()<=0)
throw 1;
v.MakeUpper();
do
{
if(r!=0)
r<<=4;
char c = v.GetAt(0);
if(c>='A'&&c<='F')
r+= (c-'A')+ 10;
else
r+= ::atoi(&c);
v=v.Right(v.GetLength()-2);
}while(!v.IsEmpty());
}
catch(...)
{
}
if(r<=0x0fff)
r = 0;
return r;
}
CString Data::VersionConvert(int v)
{
CString r = "";
try
{
if(v<=0)
throw 1;
int begin = 3;
do
{
if(!r.IsEmpty())
r+=".";
int t = v>>(4*begin);
CString tmp;
tmp.Format("%X",t);
r+=tmp;
v=v-(t<<(4*begin));
begin--;
if(begin<0)
break;
}while(v>=0);
}
catch(...)
{
}
return r;
}
TCHAR path[MAX_PATH];
::GetModuleFileName(NULL,path,MAX_PATH);
DWORD dwSize = GetFileVersionInfoSize(path,NULL);
TCHAR * versionbuf = new TCHAR[dwSize];
if(!GetFileVersionInfo(path,NULL,dwSize,versionbuf))
throw Tools::Exception("取本地程序版本失败");
VS_FIXEDFILEINFO * versioninfo;
UINT uSize = sizeof(versioninfo);
VerQueryValue(versionbuf,"//",(LPVOID *)&versioninfo,&uSize);
VersionClient = VersionConvert(versioninfo->dwFileVersionMS,versioninfo->dwFileVersionLS);
- VC取程序版本信息
- vc 取windows系统信息 版本 cpu信息 内存信息 ie版本信息 office版本
- vc 取windows系统信息 版本 cpu信息 内存信息 ie版本信息 office版本
- VC++6.0编译release版本程序生成pdb调试信息
- VC获取程序版本
- [VC++]取程序运行目录
- 程序版本信息
- Qml程序版本信息
- VC获取操作系统版本信息
- vc mfc代码中获得程序资源中版本信息的方法
- 修改vc程序的.rc资源文件中的版本信息等
- delphi内取文件版本信息
- 内存中取PE文件版本信息
- 获取程序集版本信息
- 获取程序当前版本信息
- Android 获取程序版本信息
- Qt程序加入版本信息
- Qtcreator 程序添加版本信息
- 每天学一点flash(52) 翻页组件算法(2)
- Oracle Database 10g New Features
- 关于 win32 下磁盘的遍历方法
- Understanding .NET: A Tutorial and Analysis
- Oracle入门必会(4)
- VC取程序版本信息
- 我的笔记,是关于MONTHCALCTRL控件的,以后要用的时候好看看
- FJNU 2013 王子与公主的游戏_砝码问题
- Ocp: Oracle 10g New Features For Administrators : Study Guide
- IPV4-IP地址分类-入门到精
- .NET Patterns: Architecture, Design, and Process
- SOHO族的必备要素
- poj 1287 heap+prime 最小生成树
- Programming in the .NET Environment