Click here to Skip to main content
16,006,535 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalxml file generation Pin
swarnamanoo4-May-05 19:53
swarnamanoo4-May-05 19:53 
GeneralRe: xml file generation Pin
Priyank Bolia4-May-05 23:55
Priyank Bolia4-May-05 23:55 
GeneralRe: xml file generation Pin
swarnamanoo5-May-05 17:17
swarnamanoo5-May-05 17:17 
QuestionHow to disable input focus of a Listbox control Pin
tysh4-May-05 19:45
tysh4-May-05 19:45 
AnswerRe: How to disable input focus of a Listbox control Pin
David Crow5-May-05 2:48
David Crow5-May-05 2:48 
GeneralCan't receive IR data on serial port - help me! Pin
hithesh4-May-05 19:42
hithesh4-May-05 19:42 
GeneralRead HL7 Messages Pin
.NetRams4-May-05 19:00
.NetRams4-May-05 19:00 
General840215 - Appending new accelerators to the default table Pin
ilostmyid24-May-05 18:05
professionalilostmyid24-May-05 18:05 
hi all
i wrote the following function to append one project's accelerators to another because i thought there was no function doing that. but it has a problem, +10 (something more than 2) is required. why?
status appendAcceleratorsTable(HACCEL &hAccel,LPCTSTR lpszResourceName)<br />
{<br />
	// locate and load new accelerators<br />
	HINSTANCE hInst=AfxFindResourceHandle(lpszResourceName,RT_ACCELERATOR);<br />
	ASSERT(hInst);<br />
	HACCEL hNewAccel=LoadAccelerators(hInst,lpszResourceName);<br />
	ASSERT(hNewAccel);<br />
<br />
	// calculate number of accelerators in both tables<br />
	int numAccel=CopyAcceleratorTable(hAccel,NULL,NP);<br />
	int numNewAccel=CopyAcceleratorTable(hNewAccel,NULL,NP);<br />
<br />
	// allocate a global space to hold both accelerator tables<br />
	LPACCEL lpAccel=(LPACCEL)GlobalAlloc(GPTR,(numAccel+numNewAccel+10)*sizeof(ACCEL));<br />
	ASSERT(!lpAccel);<br />
<br />
	// copy both tables in it<br />
	VERIFY(CopyAcceleratorTable(hAccel,lpAccel,numAccel)==numAccel);<br />
	VERIFY(CopyAcceleratorTable(hNewAccel,lpAccel+numAccel,numNewAccel)==numNewAccel);<br />
<br />
	// remove the previous ones and finalize<br />
	DestroyAcceleratorTable(hNewAccel);<br />
	hNewAccel=CreateAcceleratorTable(lpAccel,numAccel+numNewAccel);<br />
	ASSERT(hNewAccel);<br />
	VERIFY(CopyAcceleratorTable(hNewAccel,NULL,NP)==numAccel+numNewAccel);<br />
	DestroyAcceleratorTable(hAccel);<br />
	hAccel=hNewAccel;<br />
}<br />

GeneralAssembly questions Pin
Adam Durity4-May-05 17:58
Adam Durity4-May-05 17:58 
GeneralRe: Assembly questions Pin
Arsalan Malik4-May-05 21:11
Arsalan Malik4-May-05 21:11 
GeneralRe: Assembly questions Pin
S Douglas5-May-05 0:23
professionalS Douglas5-May-05 0:23 
GeneralGarbage Value Pin
nitin_ion4-May-05 17:48
nitin_ion4-May-05 17:48 
GeneralRe: Garbage Value Pin
tysh4-May-05 19:49
tysh4-May-05 19:49 
GeneralRe: Garbage Value Pin
David Crow5-May-05 2:52
David Crow5-May-05 2:52 
Generalm_viewList variable Pin
microsoftcertificate4-May-05 17:07
sussmicrosoftcertificate4-May-05 17:07 
GeneralRe: m_viewList variable Pin
Priyank Bolia5-May-05 0:09
Priyank Bolia5-May-05 0:09 
GeneralMSDN example chatsrvr Pin
microsoftcertificate4-May-05 13:52
sussmicrosoftcertificate4-May-05 13:52 
GeneralRe: MSDN example chatsrvr Pin
Michael Dunn4-May-05 16:33
sitebuilderMichael Dunn4-May-05 16:33 
GeneralA question on switching compilers... Pin
Brian R4-May-05 12:55
Brian R4-May-05 12:55 
GeneralRe: A question on switching compilers... Pin
David Crow5-May-05 3:08
David Crow5-May-05 3:08 
GeneralAuto-Completing CDataCombo Pin
Roshprog4-May-05 12:20
Roshprog4-May-05 12:20 
GeneralMenu reappears after being deleted Pin
elephantstar4-May-05 11:50
elephantstar4-May-05 11:50 
QuestionHow do I add text to a list control inside a property sheet? Pin
realius4-May-05 10:45
realius4-May-05 10:45 
AnswerRe: How do I add text to a list control inside a property sheet? Pin
David Crow5-May-05 3:20
David Crow5-May-05 3:20 
GeneralResizing comboboxes Pin
Jörgen Sigvardsson4-May-05 9:33
Jörgen Sigvardsson4-May-05 9:33 

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.