C++打开文件

来源:互联网 发布:java百战天虫 编辑:程序博客网 时间:2024/05/16 14:56

#include "stdafx.h"
#include <string>
#include "windows.h"
#include "shellapi.h"

using std::string;
int _tmain(int argc, _TCHAR* argv[])
{
     ShellExecute(NULL, NULL, L"C://A.doc", NULL, L"C://", SW_RESTORE);
     return 0;
}

 

这段代码可以打开A.doc文件。不过,我的终极目标是:用c++打开,并控制3dmax文件,将其导出成collada格式的文件。

 

以上代码的注意事项:

 

#include "windows.h"
#include "shellapi.h"

include的顺序不可颠倒

 

L"C://A.doc"前面的L不可少

 

啊!哈哈哈!

 

原创粉丝点击