Click here to Skip to main content
15,896,726 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: please help.. urgent Pin
Cedric Moonen29-Jun-06 20:31
Cedric Moonen29-Jun-06 20:31 
GeneralRe: please help.. urgent Pin
sriv_1830-Jun-06 23:23
sriv_1830-Jun-06 23:23 
GeneralRe: please help.. urgent Pin
Cedric Moonen1-Jul-06 2:03
Cedric Moonen1-Jul-06 2:03 
AnswerRe: please help.. urgent Pin
Hamid_RT29-Jun-06 20:43
Hamid_RT29-Jun-06 20:43 
QuestionSave button and encryption.... [modified] Pin
we3Guy29-Jun-06 19:55
we3Guy29-Jun-06 19:55 
QuestionMSMQ Sample App Pin
Rinu_Raj29-Jun-06 19:38
Rinu_Raj29-Jun-06 19:38 
AnswerRe: MSMQ Sample App Pin
Hamid_RT29-Jun-06 20:16
Hamid_RT29-Jun-06 20:16 
QuestionSizeOfResource () problem using String Table Pin
sach!!29-Jun-06 19:06
sach!!29-Jun-06 19:06 
hi !!

I am facing some problem retrieving size of a string from string Table. I am using FindResource() function to get handle for the resource.
I refered MSDN and get to know that String Table is stored as a block of memory of 16. Thus FindResource() will always give me address of that block. I am successfully retrieving handle to the block where the desired string is present.

The problem is I know at which place/ index the string is present in that block. But dont know how to retrieve it!! I want to get its size.

Can somebody plz help me on this!

Thx in advance

I am posting the code here
LPSTR GetErrorString(UINT uiStringId)
{
	int iRetVal=0;
	DWORD dwResSize=0;
	char temp[10];
	HRSRC hRes;

	//get the ID of the block
                DWORD nID = (uiStringId >> 4) + 1;

	//get the offset of the item within the block
	DWORD nitemID = uiStringId % 0x10;

	//get handle to the beginning of the block of 16 strings, where each string begins with its size
	hRes = FindResource(gl_hModule,MAKEINTRESOURCE(nID), RT_STRING); 

	
                //how to get the size of the string here, curretly giving the size of the block
               dwResSize=SizeofResource(gl_hModule,hRes);

    ....
...
..}

AnswerRe: SizeOfResource () problem using String Table Pin
Optimus Chaos29-Jun-06 20:22
Optimus Chaos29-Jun-06 20:22 
GeneralRe: SizeOfResource () problem using String Table Pin
sach!!29-Jun-06 20:42
sach!!29-Jun-06 20:42 
GeneralRe: SizeOfResource () problem using String Table Pin
David Crow30-Jun-06 3:09
David Crow30-Jun-06 3:09 
AnswerRe: SizeOfResource () problem using String Table Pin
Michael Dunn29-Jun-06 21:02
sitebuilderMichael Dunn29-Jun-06 21:02 
Questionhow to replace line of text in files using VC++ Pin
K. narasimharao29-Jun-06 19:01
K. narasimharao29-Jun-06 19:01 
Questionregarding listbox Pin
happy_ram29-Jun-06 19:01
happy_ram29-Jun-06 19:01 
AnswerRe: regarding listbox Pin
_AnsHUMAN_ 29-Jun-06 19:23
_AnsHUMAN_ 29-Jun-06 19:23 
GeneralRe: regarding listbox Pin
happy_ram29-Jun-06 19:27
happy_ram29-Jun-06 19:27 
GeneralRe: regarding listbox Pin
_AnsHUMAN_ 29-Jun-06 19:59
_AnsHUMAN_ 29-Jun-06 19:59 
GeneralRe: regarding listbox Pin
happy_ram29-Jun-06 19:39
happy_ram29-Jun-06 19:39 
GeneralRe: regarding listbox Pin
_AnsHUMAN_ 29-Jun-06 20:00
_AnsHUMAN_ 29-Jun-06 20:00 
AnswerRe: regarding listbox Pin
Hamid_RT29-Jun-06 20:11
Hamid_RT29-Jun-06 20:11 
GeneralRe: regarding listbox Pin
happy_ram29-Jun-06 20:17
happy_ram29-Jun-06 20:17 
GeneralRe: regarding listbox Pin
Hamid_RT29-Jun-06 20:32
Hamid_RT29-Jun-06 20:32 
GeneralRe: regarding listbox Pin
happy_ram29-Jun-06 20:55
happy_ram29-Jun-06 20:55 
GeneralRe: regarding listbox Pin
Hamid_RT29-Jun-06 21:22
Hamid_RT29-Jun-06 21:22 
GeneralRe: regarding listbox Pin
happy_ram29-Jun-06 21:28
happy_ram29-Jun-06 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.