相关疑难解决方法(0)

我应该如何在C++中正确使用FormatMessage()?

没有:

  • MFC
  • ATL

如何使用FormatMessage()获取错误文本HRESULT

 HRESULT hresult = application.CreateInstance("Excel.Application");

 if (FAILED(hresult))
 {
     // what should i put here to obtain a human-readable
     // description of the error?
     exit (hresult);
 }
Run Code Online (Sandbox Code Playgroud)

c++ windows error-handling formatmessage

84
推荐指数
5
解决办法
5万
查看次数

获取文件上次修改时间并进行比较

我想要一个函数,它将获取一个文件并持续多少天,如果它比那个日期更早,将返回0否则1 ...这样的东西......

例如:

int IsOlder(TCHAR *filename, int days)
{

do operation.

If last modify date was older than days variable
return 0
else
return 1

}
Run Code Online (Sandbox Code Playgroud)

这是适用于Windows的MS VC++ 6.谢谢你们!

c++ visual-c++

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×2

error-handling ×1

formatmessage ×1

visual-c++ ×1

windows ×1