step 1:Add resource like in the pic 1 .
step2 :Type the data in the notepad & paste that in resource like pic 2.
To acess the resource db we can use this code
CString dbData; dbData.LoadString(IDR_DBDATA1);
HGLOBAL hDB = NULL;
HRSRC hDBRes = FindResource(AfxGetResourceHandle(),MAKEINTRESOURCE(130),"DBDATA");
if (hDBRes==NULL) return;
DWORD size = SizeofResource(AfxGetResourceHandle(),hDBRes);
LPTSTR pRes = NULL;
hDB = LoadResource(AfxGetResourceHandle(),hDBRes);
if (!hDB) return;
pRes = (LPTSTR) (hDB);
FreeResource(hDB);
FreeResource(hDBRes);
CString csTmp = (CString) pRes;
AfxMessageBox(csTmp);
No comments:
Post a Comment