need help using : SetKeyState in keybddr.dll

need help using : SetKeyState in keybddr.dll

Post by Miguel A. Reynos » Sat, 04 Jan 2003 03:31:53



with the platform set to PDT8100_2002 and running this sample code (using a
symbol 8100[PDT8142], with 37 hard keyboard), I get a message saying the
application has performed an Illegal operation and will be shut down.
In the de*, a message saying "first chance exception in
CCObjResourceTestDlg.exe: C0000005: Access Violation", when I try to execute
"lpfnSetKeyState (UNDEFINED,UNDEFINED, FALSE)"

Here is the sample code:

#include <kbdapi.h>
typedef BOOL (WINAPI* LPFNSETKEYSTATE)(DWORD dwState,DWORD dwActiveModifer,
BOOL bUpdateRegistry);

LPFNSETKEYSTATE  lpfnSetKeyState;

#define FUNCTION 0x80
#define CAPSLOCK 0x40
#define NUMLOCK  0x20
#define UNDEFINED 0x10
#define ALT   0x08
#define CONTROL  0x04
#define SHIFTED  0x02
#define UNSHIFTED 0x01

void CCObjResourceTestDlg::OnButton1()
{
 m_hKeydbDll =  LoadLibrary(TEXT("keybddr.dll"));

 if ( m_hKeydbDll )
  MessageBox (_T("Library Loaded"));

 CString tmp;
 lpfnSetKeyState = (LPFNSETKEYSTATE) GetProcAddress
(m_hKeydbDll,TEXT("SetKeyState"));

 tmp.Format (_T("SetKeyState <0x%0x>(%ld)"), lpfnSetKeyState,
lpfnSetKeyState);

 if ( lpfnSetKeyState )
  MessageBox (tmp);

 if ( lpfnSetKeyState (UNDEFINED,UNDEFINED, FALSE) )
  MessageBox (_T("KeyStateChanged"));

 if ( FreeLibrary (m_hKeydbDll) )
  MessageBox (_T("Library Freed"));

Quote:}

I am trying to set the keyboard's state to alpha or numeric, if anyone knows
a better way of doing this, please let me know.
 
 
 

1. need help using : SetKeyState in keybddr.dll

with the platform set to PDT8100_2002 and running this sample code (using a
symbol 8100[PDT8142], with 37 hard keyboard), I get a message saying the
application has performed an Illegal operation and will be shut down.
In the debugger, a message saying "first chance exception in
CCObjResourceTestDlg.exe: C0000005: Access Violation", when I try to execute
"lpfnSetKeyState (UNDEFINED,UNDEFINED, FALSE)"

Here is the sample code:

#include <kbdapi.h>
typedef BOOL (WINAPI* LPFNSETKEYSTATE)(DWORD dwState,DWORD dwActiveModifer,
BOOL bUpdateRegistry);

LPFNSETKEYSTATE  lpfnSetKeyState;

#define FUNCTION 0x80
#define CAPSLOCK 0x40
#define NUMLOCK  0x20
#define UNDEFINED 0x10
#define ALT   0x08
#define CONTROL  0x04
#define SHIFTED  0x02
#define UNSHIFTED 0x01

void CCObjResourceTestDlg::OnButton1()
{
 m_hKeydbDll =  LoadLibrary(TEXT("keybddr.dll"));

 if ( m_hKeydbDll )
  MessageBox (_T("Library Loaded"));

 CString tmp;
 lpfnSetKeyState = (LPFNSETKEYSTATE) GetProcAddress
(m_hKeydbDll,TEXT("SetKeyState"));

 tmp.Format (_T("SetKeyState <0x%0x>(%ld)"), lpfnSetKeyState,
lpfnSetKeyState);

 if ( lpfnSetKeyState )
  MessageBox (tmp);

 if ( lpfnSetKeyState (UNDEFINED,UNDEFINED, FALSE) )
  MessageBox (_T("KeyStateChanged"));

 if ( FreeLibrary (m_hKeydbDll) )
  MessageBox (_T("Library Freed"));

I am trying to set the keyboard's state to alpha or numeric, if anyone knows
a better way of doing this, please let me know.

2. WAITCOMMEVENT AND READFILE ON PXA250

3. keybddr.dll, Alpha mode, Symbol

4. disc utility

5. Help needed on using CTL3DV2.DLL with OWL1.0

6. XP won't start.

7. Help needed! DLL using ActiveX ICP.

8. After shutdown, win XP won't power down

9. Need Help to Change Netscape Communicator's Plug-ins Data

10. Need Help with Plug-ins

11. AVI PLUG-INS: need help

12. Need Help to Change Netscape Communicator's Plug-ins Data

13. I am missing a DLL file : MPLAPX.DLL, NEED HELP FINDING IT!