Error in loading accelerator table
-
Hi, LoadAccelerators function is returning NULL value. im using the following code: HACCEL m_hAccelTable1; m_hAccelTable1 = LoadAccelerators(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR2)); GetLastError function is returning 1814 error value which states that "The specified resource name cannot be found in the image file". The accelerator table is present in the resource file. Anyone please tell me where i did the mistake? Thanks,
-
Hi, LoadAccelerators function is returning NULL value. im using the following code: HACCEL m_hAccelTable1; m_hAccelTable1 = LoadAccelerators(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR2)); GetLastError function is returning 1814 error value which states that "The specified resource name cannot be found in the image file". The accelerator table is present in the resource file. Anyone please tell me where i did the mistake? Thanks,
Check if
IDR_ACCELERATOR2
is the right value to pass. You could even check if that is the right value by opening the .RC file in text mode.«_Superman_»
I love work. It gives me something to do between weekends. -
Check if
IDR_ACCELERATOR2
is the right value to pass. You could even check if that is the right value by opening the .RC file in text mode.«_Superman_»
I love work. It gives me something to do between weekends. -
Check if
IDR_ACCELERATOR2
is the right value to pass. You could even check if that is the right value by opening the .RC file in text mode.«_Superman_»
I love work. It gives me something to do between weekends. -
It is there in the resource file: ///////////////////////////////////////////////////////////////////////////// // // Accelerator // IDR_ACCELERATOR2 ACCELERATORS DISCARDABLE BEGIN "V", IDC_BMP_VIEW, VIRTKEY, NOINVERT END
Is the accelerator table resource part of the EXE project or any other DLL that the EXE loads?
«_Superman_»
I love work. It gives me something to do between weekends. -
Is the accelerator table resource part of the EXE project or any other DLL that the EXE loads?
«_Superman_»
I love work. It gives me something to do between weekends. -
Yeah, accelerator tables can be stored in executables (PE files) as resources (if that's what you're asking). In fact it where they're normally stored. They're loaded with the LoadAccelerators[^] function.
Steve
-
Hi, LoadAccelerators function is returning NULL value. im using the following code: HACCEL m_hAccelTable1; m_hAccelTable1 = LoadAccelerators(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR2)); GetLastError function is returning 1814 error value which states that "The specified resource name cannot be found in the image file". The accelerator table is present in the resource file. Anyone please tell me where i did the mistake? Thanks,
Check the
HINSTANCE
handle is referring to the correct DLL.Steve
-
In that case the error is in using the
AfxGetInstanceHandle
function. Instead useGetModuleHandle
with the name of the DLL as parameter.«_Superman_»
I love work. It gives me something to do between weekends. -
In that case the error is in using the
AfxGetInstanceHandle
function. Instead useGetModuleHandle
with the name of the DLL as parameter.«_Superman_»
I love work. It gives me something to do between weekends. -
Check the
HINSTANCE
handle is referring to the correct DLL.Steve