这篇教程C++ CopyFileA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CopyFileA函数的典型用法代码示例。如果您正苦于以下问题:C++ CopyFileA函数的具体用法?C++ CopyFileA怎么用?C++ CopyFileA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CopyFileA函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: load bool load(const arguments & args_, std::string & result) { HMODULE dllHandle; RVExtension function; LOG(INFO) << "Load requested [" << args_.as_string(0) << "]"; if (_modules.find(args_.as_string(0)) != _modules.end()) { LOG(ERROR) << "Module already loaded [" << args_.as_string(0) << "]"; return true; }#ifdef _WINDOWS // Make a copy of the file to temp, and load it from there, referencing the current path name char tmpPath[MAX_PATH +1], buffer[MAX_PATH + 1]; if(!GetTempPathA(MAX_PATH, tmpPath)) { LOG(ERROR) << "GetTempPath() failed, e=" << GetLastError(); return false; } if(!GetTempFileNameA(tmpPath, "ace_dynload", TRUE, buffer)) { LOG(ERROR) << "GetTempFileName() failed, e=" << GetLastError(); return false; } std::string temp_filename = buffer; if (!CopyFileA(args_.as_string(0).c_str(), temp_filename.c_str(), FALSE)) { DeleteFile(temp_filename.c_str()); if (!CopyFileA(args_.as_string(0).c_str(), temp_filename.c_str(), FALSE)) { LOG(ERROR) << "CopyFile() , e=" << GetLastError(); return false; } }#else std::string temp_filename = args_.as_string(0);#endif dllHandle = LoadLibrary(temp_filename.c_str()); if (!dllHandle) { LOG(ERROR) << "LoadLibrary() failed, e=" << GetLastError() << " [" << args_.as_string(0) << "]"; return false; } function = (RVExtension)GetProcAddress(dllHandle, "[email C++ CopyFileW函数代码示例 C++ CopyBeforeWrite函数代码示例
|