Windows 编程相关
1 读取资源文件中的文件
HRSRC hResource = FindResource(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MYFILE), TEXT("MYFILE")); if(hResource) { HGLOBAL hg = LoadResource(GetModuleHandle(NULL), hResource); if(hg) { LPVOID pData = LockResource(hg); if(pData) { DWORD dwSize = SizeofResource(GetModuleHandle(NULL), hResource); CFile myFile; if(myFile.Open("c:\\myfile", CFile::modeCreate | CFile::modeReadWrite)) { myFile.Write(pData, dwSize); //注意:dwSize太大的要分几次写 myFile.Close(); } } } }