Coverting char to BYTE.

This is a discussion on Coverting char to BYTE. within the Windows Programming forums, part of the Platform Specific Boards category; How can I convert the char type into the BYTE type? For an example: 'a' would be 0x41. And: 'A' ...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Question Coverting char to BYTE.

    How can I convert the char type into the BYTE type?
    For an example:

    'a' would be 0x41.

    And:

    'A' would be VK_SHIFT and 0x41.

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    a character is a BYTE. 'a' and 'A' are not the same.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Okay, I am trying to use a char var in the keybd_event() function, but it wants a BYTE instead. How should I do that?

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    Quote Originally Posted by Cool-August
    Okay, I am trying to use a char var in the keybd_event() function, but it wants a BYTE instead. How should I do that?
    (BYTE)VarName

  5. #5
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    No offence Denethor2000, but I'm that stupid, I've already tried that a dozen times.

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,318
    A BYTE is just a typedef for an unsigned char. Show your code and explain the problems you are having.

  7. #7
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    if you are trying to stuff the keyboard with some text just as if someone typed it at the keyboard, then use one of the keyboard functions, such as keybd_event

    follow the link and it will show you a list of all the VK_* keys.

  8. #8
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Quote Originally Posted by Cool-August
    No offence Denethor2000, but I'm that stupid, I've already tried that a dozen times.
    You obviously aren't that smart since you haven't shown a single piece of code.

    Also going to move this to the windows board

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  2. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 11:36 AM
  3. BYTE, char data corruption
    By Denethor2000 in forum C++ Programming
    Replies: 45
    Last Post: 11-12-2005, 05:39 PM
  4. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  5. I'm having a problem with data files.
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 05-14-2003, 09:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21