用于编写捕获Windows错误消息的例程的示例代码 [英] Sample code to write a routine that catches the Windows error messages

查看:105
本文介绍了用于编写捕获Windows错误消息的例程的示例代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int main()
{
  string filename="c:\\sample.png"//needs to validate the  filename with forbidden char

//here i m giving the filepath but it needs to escape the filepth& need to validate filename

// can any one help me how handle this situation 

}

推荐答案

你可以使用 splitpath 功能,用于检查有效路径。并按照最后的描述检查错误。
you can use the splitpath function to check for a valid path. And check the errno as described in the end.


这篇关于用于编写捕获Windows错误消息的例程的示例代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆