如何读取程序资源里面的文本文件啊. 如何读取程序资源里面的文本文件啊.导入一个文本文件到资源里面,比如ID号为IDR_TXTCFile file;file.Open(IDR_TXT,CFile::modeRead)为什么不行啊,请高人指点. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 The following code snippet get a pointer to the resource HRSRC hResLoad = NULL; // handle to loaded resource HMODULE hExe = NULL; // handle to existing .EXE file HRSRC hRes = NULL; // handle/ptr. to res. info. in hExe LPVOID lpResLock = NULL; // pointer to resource data hRes = FindResource(hExe, MAKEINTRESOURCE(resid), restype); if (hRes == NULL) { return E_FAIL; } hResLoad = (HRSRC)LoadResource(hExe, hRes); if (hResLoad == NULL) { return E_FAIL; } lpResLock = LockResource(hResLoad); if (lpResLock == NULL) { return E_FAIL; } int fileSize = SizeofResource(hExe, hRes);//the text file is stored in lpResLock 上面贴错地方了。。http://www.yesky.com/436/1883936.shtml VS2005下SerialPort问题 请教windows服务无法截取图像的问题? 多线程串口操作 如何通过代理服务器打开被电信禁了的网站? CArray的一个简单问题~~苦恼ing~~ 关于最大连接数的探讨 用NDIS开发应该到什么地方下载什么东西! 兄弟们给出点点子! (random(10)<5)?'0':'1'请问这句什么意思 基于对话框的程序怎么修改静态文本框和按钮控件上的字体?? 对话框初始化时创建一个窗口为何出错? 子对话框打开时在初始化对话框函数中创建了一个线程 时时监视子对话中Edit控件的输入情况 为什么不行
HRSRC hResLoad = NULL; // handle to loaded resource
HMODULE hExe = NULL; // handle to existing .EXE file
HRSRC hRes = NULL; // handle/ptr. to res. info. in hExe
LPVOID lpResLock = NULL; // pointer to resource data hRes = FindResource(hExe, MAKEINTRESOURCE(resid), restype);
if (hRes == NULL)
{
return E_FAIL;
}
hResLoad = (HRSRC)LoadResource(hExe, hRes);
if (hResLoad == NULL)
{
return E_FAIL;
}
lpResLock = LockResource(hResLoad);
if (lpResLock == NULL)
{
return E_FAIL;
}
int fileSize = SizeofResource(hExe, hRes);
//the text file is stored in lpResLock
http://www.yesky.com/436/1883936.shtml