Click here to Skip to main content
16,007,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralInternal compiler error C1001 Pin
Bob Stanneveld6-Oct-04 12:26
Bob Stanneveld6-Oct-04 12:26 
GeneralRe: Internal compiler error C1001 Pin
Joaquín M López Muñoz6-Oct-04 12:45
Joaquín M López Muñoz6-Oct-04 12:45 
GeneralSolved. Pin
Bob Stanneveld7-Oct-04 2:27
Bob Stanneveld7-Oct-04 2:27 
GeneralRe: Internal compiler error C1001 Pin
Anonymous6-Oct-04 15:01
Anonymous6-Oct-04 15:01 
GeneralRe: Internal compiler error C1001 Pin
David Crow6-Oct-04 16:40
David Crow6-Oct-04 16:40 
GeneralRe: Internal compiler error C1001 Pin
Ryan Binns6-Oct-04 18:41
Ryan Binns6-Oct-04 18:41 
GeneralRe: Internal compiler error C1001 Pin
Bob Stanneveld7-Oct-04 2:35
Bob Stanneveld7-Oct-04 2:35 
GeneralDialog accelerators Pin
Atlence6-Oct-04 12:14
Atlence6-Oct-04 12:14 
Hi!

I have created a dialog-based application, and I want to create accelerators. For example, when the user presses F2 key, I want to show the aboutbox dialog.

In the OnInitDialog function, I added the following lines:
<br />
// Accelerators<br />
	HACCEL m_hAccel=::LoadAccelerators(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_ACCELERATOR));<br />
	ASSERT(m_hAccel);<br />


m_hAccel is defined as HACCEL.

Also, I added the following member function:
<br />
BOOL CCRDlg::PreTranslateMessage(MSG* pMsg)<br />
{<br />
	if (m_hAccel != NULL && TranslateAccelerator(m_hWnd, m_hAccel, pMsg))<br />
		return TRUE;<br />
<br />
	return CDialog::PreTranslateMessage(pMsg);<br />
}


My Resource definition is defined like this:
<br />
/////////////////////////////////////////////////////////////////////////////<br />
//<br />
// Accelerator<br />
//<br />
<br />
IDR_ACCELERATOR ACCELERATORS <br />
BEGIN<br />
    VK_F2,          ID_ABOUT,             VIRTKEY, NOINVERT<br />
END


But this code doesn't work, my accelerators don't generate a WM_COMMAND.....

What's the problem?

Thks in advance!
Appstmd
http://www.atlence.com
GeneralRe: Dialog accelerators Pin
David Crow6-Oct-04 16:42
David Crow6-Oct-04 16:42 
GeneralTransparent Slider Pin
Atlence6-Oct-04 12:07
Atlence6-Oct-04 12:07 
GeneralAccelerators ... Pin
Andre Massada6-Oct-04 11:24
Andre Massada6-Oct-04 11:24 
GeneralMapping Right mouse click to button click Pin
Manu816-Oct-04 10:59
Manu816-Oct-04 10:59 
GeneralRe: Mapping Right mouse click to button click Pin
Yulianto.6-Oct-04 18:08
Yulianto.6-Oct-04 18:08 
GeneralRe: Mapping Right mouse click to button click Pin
sreejith ss nair7-Oct-04 0:17
sreejith ss nair7-Oct-04 0:17 
GeneralCaption Names Pin
jj9216-Oct-04 9:40
jj9216-Oct-04 9:40 
GeneralRe: Caption Names Pin
Ravi Bhavnani6-Oct-04 10:42
professionalRavi Bhavnani6-Oct-04 10:42 
GeneralRe: Caption Names Pin
Joaquín M López Muñoz6-Oct-04 11:16
Joaquín M López Muñoz6-Oct-04 11:16 
GeneralEach letter a diffetent color to a dc Pin
...---...6-Oct-04 9:30
...---...6-Oct-04 9:30 
GeneralRe: Each letter a diffetent color to a dc Pin
Maximilien6-Oct-04 9:42
Maximilien6-Oct-04 9:42 
GeneralNon client area events mouse hook Pin
anandforu6-Oct-04 9:11
anandforu6-Oct-04 9:11 
GeneralRe: Non client area events mouse hook Pin
David Crow6-Oct-04 9:28
David Crow6-Oct-04 9:28 
GeneralRe: Non client area events mouse hook Pin
Blake Miller6-Oct-04 9:59
Blake Miller6-Oct-04 9:59 
GeneralRename file to Unicode name Pin
Microwonk6-Oct-04 9:11
Microwonk6-Oct-04 9:11 
GeneralRe: Rename file to Unicode name Pin
Microwonk11-Oct-04 7:46
Microwonk11-Oct-04 7:46 
QuestionAnyone up for a challenge? Pin
zumichu6-Oct-04 9:05
zumichu6-Oct-04 9:05 

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.