设为首页 加入收藏

TOP

VC++ 创建msi文件(二)
2014-07-19 23:02:58 来源: 作者: 【 】 浏览:157
Tags:  创建 msi 文件

 

  //output error message.

  MessageBoxEx(

  NULL,

  (LPTSTR)formatMsg,

  _T("tip window"),

  MB_OK,

  MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT));

  //free message buffer.

  LocalFree(formatMsg);

  formatMsg=NULL;

  return -1;

  }

  //close msi database handle.

  UINT closeResult=MsiCloseHandle(msiHandle);

  if(closeResult != ERROR_SUCCESS)

  {

  LPVOID formatMsg=NULL;

  MSIHANDLE errorCode=MsiGetLastErrorRecord();

  //format error code to string.

  FormatMessage(

  FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,

  NULL,

  errorCode,

  MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT),

  (LPTSTR)&formatMsg,

  0,

  NULL);

  //output error message.

  MessageBoxEx(

  NULL,

  (LPTSTR)formatMsg,

  _T("tip window"),

  MB_OK,

  MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT));

  //free message buffer.

  LocalFree(formatMsg);

  formatMsg=NULL;

  return -1;

  }

  return 0;

  }

  </SPAN>

  结果展示

\

  总结

  现在我研究的还不是很明白,不过最终的目的就是自己编写的软件需要一个安装程序,这样子就看着专业一些了,总是绿色软件很是不甘心。

      

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇vc++教程之win7下基址定位处理 下一篇VC++对XML文件操作

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·About - Redis (2025-12-26 08:20:56)
·Redis: A Comprehens (2025-12-26 08:20:53)
·Redis - The Real-ti (2025-12-26 08:20:50)
·Bash 脚本教程——Li (2025-12-26 07:53:35)
·实战篇!Linux shell (2025-12-26 07:53:32)