Virtual Keyboard

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Cliff Nichols
    Member
    • Aug 2006
    • 3753

    Virtual Keyboard

    In one of the other threads, I mentioned how I use a virtual keyboard for a demonstration/tutorial in one of my programs. MCM mentioned how it may be helpful to others in return for the help they have given me in the past. Once the thought hit me that it may be useful to someone else, I set out to strip things down to a simple demo, but it looks like yet again I could use a little help.

    My resource file says it compiles correctly, but when I compile the program, the pbr file opens and shows a bunch of binary codes, and the compiler starts cascading the same error (increment the line # for each error) all reading
    Line # is over 256 characters. Splitting into shorter lines.
    can anyone spot what I did wrong in my rc file?
    Code:
    #include "resource.h"
    //BITMAPS FOR KEYBOARD
         #define IDM_KEYBOARDTILDE           WM_USER + 1000
         #define IDM_KEYBOARD1               WM_USER + 1001
         #define IDM_KEYBOARD2               WM_USER + 1002
         #define IDM_KEYBOARD3               WM_USER + 1003
         #define IDM_KEYBOARD4               WM_USER + 1004
         #define IDM_KEYBOARD5               WM_USER + 1005
         #define IDM_KEYBOARD6               WM_USER + 1006
         #define IDM_KEYBOARD7               WM_USER + 1007
         #define IDM_KEYBOARD8               WM_USER + 1008
         #define IDM_KEYBOARD9               WM_USER + 1009
         #define IDM_KEYBOARD0               WM_USER + 1010
         #define IDM_KEYBOARDMINUS           WM_USER + 1011
         #define IDM_KEYBOARDEQUALS          WM_USER + 1012
         #define IDM_KEYBOARDBACKSPACE       WM_USER + 1013
    
         #define IDM_KEYBOARDTAB             WM_USER + 1014
         #define IDM_KEYBOARDQ               WM_USER + 1015
         #define IDM_KEYBOARDW               WM_USER + 1016
         #define IDM_KEYBOARDE               WM_USER + 1017
         #define IDM_KEYBOARDR               WM_USER + 1018
         #define IDM_KEYBOARDT               WM_USER + 1019
         #define IDM_KEYBOARDY               WM_USER + 1020
         #define IDM_KEYBOARDU               WM_USER + 1021
         #define IDM_KEYBOARDI               WM_USER + 1022
         #define IDM_KEYBOARDO               WM_USER + 1023
         #define IDM_KEYBOARDP               WM_USER + 1024
         #define IDM_KEYBOARDLEFTBRACKET     WM_USER + 1025
         #define IDM_KEYBOARDRIGHTBRACKET    WM_USER + 1026
    
         #define IDM_KEYBOARDCAPSLOCK        WM_USER + 1027
         #define IDM_KEYBOARDA               WM_USER + 1028
         #define IDM_KEYBOARDS               WM_USER + 1029
         #define IDM_KEYBOARDD               WM_USER + 1030
         #define IDM_KEYBOARDF               WM_USER + 1031
         #define IDM_KEYBOARDG               WM_USER + 1032
         #define IDM_KEYBOARDH               WM_USER + 1033
         #define IDM_KEYBOARDJ               WM_USER + 1034
         #define IDM_KEYBOARDK               WM_USER + 1035
         #define IDM_KEYBOARDL               WM_USER + 1036
         #define IDM_KEYBOARDSEMICOLON       WM_USER + 1037
         #define IDM_KEYBOARDAPOSTROPHE      WM_USER + 1038
         #define IDM_KEYBOARDENTER           WM_USER + 1039
    
         #define IDM_KEYBOARDLEFTSHIFT       WM_USER + 1040
         #define IDM_KEYBOARDZ               WM_USER + 1041
         #define IDM_KEYBOARDX               WM_USER + 1042
         #define IDM_KEYBOARDC               WM_USER + 1043
         #define IDM_KEYBOARDV               WM_USER + 1044
         #define IDM_KEYBOARDB               WM_USER + 1045
         #define IDM_KEYBOARDN               WM_USER + 1046
         #define IDM_KEYBOARDM               WM_USER + 1047
         #define IDM_KEYBOARDCOMMA           WM_USER + 1048
         #define IDM_KEYBOARDPERIOD          WM_USER + 1049
         #define IDM_KEYBOARDBACKSLASH       WM_USER + 1050
         #define IDM_KEYBOARDRIGHTSHIFT      WM_USER + 1051
         #define IDM_KEYBOARDFORWARDSLASH    WM_USER + 1052
    
         #define IDM_KEYBOARDLEFTCONTROL     WM_USER + 1053
         #define IDM_KEYBOARDWINDOWS         WM_USER + 1054
         #define IDM_KEYBOARDLEFTALT         WM_USER + 1055
         #define IDM_KEYBOARDSPACEBAR        WM_USER + 1056
         #define IDM_KEYBOARDRIGHTALT        WM_USER + 1057
         #define IDM_KEYBOARDMENU            WM_USER + 1058
         #define IDM_KEYBOARDRIGHTCONTROL    WM_USER + 1059
    //ACTUAL BITMAPS
    STD_KEYBOARDTILDE           BITMAP DISCARDABLE ".\Keyboard\Button Down -.bmp"
    STD_KEYBOARD1               BITMAP DISCARDABLE ".\Keyboard\Button Down 1.bmp"
    STD_KEYBOARD2               BITMAP DISCARDABLE ".\Keyboard\Button Down 2.bmp"
    STD_KEYBOARD3               BITMAP DISCARDABLE ".\Keyboard\Button Down 3.bmp"
    STD_KEYBOARD4               BITMAP DISCARDABLE ".\Keyboard\Button Down 4.bmp"
    STD_KEYBOARD5               BITMAP DISCARDABLE ".\Keyboard\Button Down 5.bmp"
    STD_KEYBOARD6               BITMAP DISCARDABLE ".\Keyboard\Button Down 6.bmp"
    STD_KEYBOARD7               BITMAP DISCARDABLE ".\Keyboard\Button Down 7.bmp"
    STD_KEYBOARD8               BITMAP DISCARDABLE ".\Keyboard\Button Down 8.bmp"
    STD_KEYBOARD9               BITMAP DISCARDABLE ".\Keyboard\Button Down 9.bmp"
    STD_KEYBOARD0               BITMAP DISCARDABLE ".\Keyboard\Button Down 0.bmp"
    STD_KEYBOARDMINUS           BITMAP DISCARDABLE ".\Keyboard\Button Down -.bmp"
    STD_KEYBOARDEQUALS          BITMAP DISCARDABLE ".\Keyboard\Button Down =.bmp"
    STD_KEYBOARDBACKSPACE       BITMAP DISCARDABLE ".\Keyboard\Button Down BackSpace.bmp"
    
    STD_KEYBOARDTAB             BITMAP DISCARDABLE ".\Keyboard\Button Down Tab.bmp"
    STD_KEYBOARDQ               BITMAP DISCARDABLE ".\Keyboard\Button Down Q.bmp"
    STD_KEYBOARDW               BITMAP DISCARDABLE ".\Keyboard\Button Down W.bmp"
    STD_KEYBOARDE               BITMAP DISCARDABLE ".\Keyboard\Button Down E.bmp"
    STD_KEYBOARDR               BITMAP DISCARDABLE ".\Keyboard\Button Down R.bmp"
    STD_KEYBOARDT               BITMAP DISCARDABLE ".\Keyboard\Button Down T.bmp"
    STD_KEYBOARDY               BITMAP DISCARDABLE ".\Keyboard\Button Down Y.bmp"
    STD_KEYBOARDU               BITMAP DISCARDABLE ".\Keyboard\Button Down U.bmp"
    STD_KEYBOARDI               BITMAP DISCARDABLE ".\Keyboard\Button Down I.bmp"
    STD_KEYBOARDO               BITMAP DISCARDABLE ".\Keyboard\Button Down O.bmp"
    STD_KEYBOARDP               BITMAP DISCARDABLE ".\Keyboard\Button Down P.bmp"
    STD_KEYBOARDLEFTBRACKET     BITMAP DISCARDABLE ".\Keyboard\Button Down [.bmp"
    STD_KEYBOARDRIGHTBRACKET    BITMAP DISCARDABLE ".\Keyboard\Button Down ].bmp"
    
    STD_KEYBOARDCAPSLOCK        BITMAP DISCARDABLE ".\Keyboard\Button Down Capslock.bmp"
    STD_KEYBOARDA               BITMAP DISCARDABLE ".\Keyboard\Button Down A.bmp"
    STD_KEYBOARDS               BITMAP DISCARDABLE ".\Keyboard\Button Down S.bmp"
    STD_KEYBOARDD               BITMAP DISCARDABLE ".\Keyboard\Button Down D.bmp"
    STD_KEYBOARDF               BITMAP DISCARDABLE ".\Keyboard\Button Down F.bmp"
    STD_KEYBOARDG               BITMAP DISCARDABLE ".\Keyboard\Button Down G.bmp"
    STD_KEYBOARDH               BITMAP DISCARDABLE ".\Keyboard\Button Down H.bmp"
    STD_KEYBOARDJ               BITMAP DISCARDABLE ".\Keyboard\Button Down J.bmp"
    STD_KEYBOARDK               BITMAP DISCARDABLE ".\Keyboard\Button Down K.bmp"
    STD_KEYBOARDL               BITMAP DISCARDABLE ".\Keyboard\Button Down L.bmp"
    STD_KEYBOARDSEMICOLON       BITMAP DISCARDABLE ".\Keyboard\Button Down ;.bmp"
    STD_KEYBOARDAPOSTROPHE      BITMAP DISCARDABLE ".\Keyboard\Button Down '.bmp"
    STD_KEYBOARDENTER           BITMAP DISCARDABLE ".\Keyboard\Button Down Enter.bmp"
    
    STD_KEYBOARDLEFTSHIFT       BITMAP DISCARDABLE ".\Keyboard\Button Down Shift.bmp"
    STD_KEYBOARDZ               BITMAP DISCARDABLE ".\Keyboard\Button Down Z.bmp"
    STD_KEYBOARDX               BITMAP DISCARDABLE ".\Keyboard\Button Down X.bmp"
    STD_KEYBOARDC               BITMAP DISCARDABLE ".\Keyboard\Button Down C.bmp"
    STD_KEYBOARDV               BITMAP DISCARDABLE ".\Keyboard\Button Down V.bmp"
    STD_KEYBOARDB               BITMAP DISCARDABLE ".\Keyboard\Button Down B.bmp"
    STD_KEYBOARDN               BITMAP DISCARDABLE ".\Keyboard\Button Down N.bmp"
    STD_KEYBOARDM               BITMAP DISCARDABLE ".\Keyboard\Button Down M.bmp"
    STD_KEYBOARDCOMMA           BITMAP DISCARDABLE ".\Keyboard\Button Down ,.bmp"
    STD_KEYBOARDPERIOD          BITMAP DISCARDABLE ".\Keyboard\Button Down ..bmp"
    STD_KEYBOARDBACKSLASH       BITMAP DISCARDABLE ".\Keyboard\Button Down Backslash.bmp"
    STD_KEYBOARDRIGHTSHIFT      BITMAP DISCARDABLE ".\Keyboard\Button Down Shift.bmp"
    STD_KEYBOARDFORWARDSLASH    BITMAP DISCARDABLE ".\Keyboard\Button Down ForwardSlash.bmp"
    
    STD_KEYBOARDLEFTCONTROL     BITMAP DISCARDABLE ".\Keyboard\Button Down Ctrl.bmp"
    STD_KEYBOARDWINDOWS         BITMAP DISCARDABLE ".\Keyboard\Button Down Windows.bmp"
    STD_KEYBOARDLEFTALT         BITMAP DISCARDABLE ".\Keyboard\Button Down Alt.bmp"
    STD_KEYBOARDSPACEBAR        BITMAP DISCARDABLE ".\Keyboard\Button Down Spacebar.bmp"
    STD_KEYBOARDRIGHTALT        BITMAP DISCARDABLE ".\Keyboard\Button Down Alt.bmp"
    STD_KEYBOARDMENU            BITMAP DISCARDABLE ".\Keyboard\Button Down Menu.bmp"
    STD_KEYBOARDRIGHTCONTROL    BITMAP DISCARDABLE ".\Keyboard\Button Down Ctrl.bmp"
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "
  • Michael Mattias
    Member
    • Aug 1998
    • 43447

    #2
    I think the 'issue/problem/difficulty' is in your *.bas file, since the compiler does not touch the *.rc when it is compiling a program.

    Maybe you have a couple of lines strung together, having deleted a couple of carriage returns at or near the #RESOURCE line?
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment

    • Cliff Nichols
      Member
      • Aug 2006
      • 3753

      #3
      I took things a step back, and created a new *.rc file from the PB template and got the same sort of results. So I am TOTALLY confused now

      Before that advent of boilerplate files from PB itself, I always assumed that I did something wrong. But now not so sure.

      Boilerplate code:
      Code:
      #include "resource.h"
      
      // * Version info.
      //
      //
      
      VS_VERSION_INFO VERSIONINFO
      FILEVERSION 1, 0, 0, 0
      PRODUCTVERSION 1, 0, 0, 0
      FILEOS VOS_WINDOWS32
      FILETYPE VFT_APP
      BEGIN
        BLOCK "StringFileInfo"
        BEGIN
          BLOCK "040904B0"
          BEGIN
            VALUE "CompanyName",      "My Company, Inc.\000"
            VALUE "FileDescription",  "Program for doing neat stuff\000"
            VALUE "FileVersion",      "01.00.0000\000"
            VALUE "InternalName",     "MyProgramName\000"
            VALUE "OriginalFilename", "MyProgramName.EXE\000"
            VALUE "LegalCopyright",   "Copyright \251 2004 My Company, Inc.\000"
            VALUE "ProductName",      "My Product Name\000"
            VALUE "ProductVersion",   "01.00.0000\000"
            VALUE "Comments",         "Rah! Rah! Rah!\000"
          END
        END
        BLOCK "VarFileInfo"
        BEGIN
          VALUE "Translation", 0x409, 0x4B0
        END
      END
      and the results when I compile the *.pbr into my program:
      Code:
       CR   H                       €                  0  €                     H   X   `          `4   V S _ V E R S I O N _ I N F O     ½ïþ                                           ¾   S t r i n g F i l e I n f o   š   0 4 0 9 0 4 B 0   _
      B   C o m p a n y N a m e     M y   C o m p a n y ,   I n c .     b   F i l e D e s c r i p t i o n     P r o g r a m   f o r   d o i n g   n e a t   s t u f f     6   F i l e V e r s i o n     0 1 . 0 0 . 0 0 0 0     <   I n t e r n a l N a m e  _
       M y P r o g r a m N a m e   L   O r i g i n a l F i l e n a m e   M y P r o g r a m N a m e . E X E   h "  L e g a l C o p y r i g h t   C o p y r i g h t   ©   2 0 0 4   M y   C o m p a n y ,   I n c .   @   P r o d u c t N a m e     M y   P r o d _
      u c t   N a m e   :   P r o d u c t V e r s i o n   0 1 . 0 0 . 0 0 0 0     6   C o m m e n t s   R a h !   R a h !   R a h !     D    V a r F i l e I n f o     $    T r a n s l a t i o n       °
      Note: Many unprintable characters in the above results, and posting here, many characters are different than what is seen when I run the program.

      But just so someone else can see the problems and maybe a solution
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "

      Comment

      • Michael Mattias
        Member
        • Aug 1998
        • 43447

        #4
        You didn't try to #INCLUDE "filename.pbr" instead of #RESOURCE "filename.pbr", did you?

        That would explain what you are getting.

        (CODE NOT SHOWN).
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment

        • Cliff Nichols
          Member
          • Aug 2006
          • 3753

          #5
          Thanks MCM....another good guess at what I forgot to add....(sorry bout that, I thought I posted all the parts involved and boy was I wrong )

          Anyways thanx again for the help. I am off to see if I can use BinBas to allow me to post the resource files. (unless you or others know of some better ways short of hosting a download section somewhere, which may be shorter but would not offer up a pure code solution)

          side note: (DUHHHHHhhh Cliff...when all else fails, look for the obvious)
          Engineer's Motto: If it aint broke take it apart and fix it

          "If at 1st you don't succeed... call it version 1.0"

          "Half of Programming is coding"....."The other 90% is DEBUGGING"

          "Document my code????" .... "WHYYY??? do you think they call it CODE? "

          Comment

          • Clay Clear
            Member
            • Jan 2000
            • 4486

            #6
            In resources, backslashes in quotes have to be escaped with a second backslash. Change all occurrences of a single "\" to "\\". My own XP has pulled some very weird stuff when my own compiled programs had resource errors, especially when forgetting to escape backslashes in .rc files.

            Comment

            • Cliff Nichols
              Member
              • Aug 2006
              • 3753

              #7
              Virtual Keyboard in Source Code Forum

              Well I finally got everything fixed up and posted in the Source Code Forum Virtual Keyboard Routines

              Hope it comes in handy for someone
              Engineer's Motto: If it aint broke take it apart and fix it

              "If at 1st you don't succeed... call it version 1.0"

              "Half of Programming is coding"....."The other 90% is DEBUGGING"

              "Document my code????" .... "WHYYY??? do you think they call it CODE? "

              Comment

              Working...
              X