Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Notepad application

Notepad application

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
19 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ram Murali
    wrote on last edited by
    #1

    Hi all, I would like to create single document interface something like notepad. Now my problem is i created the basic display. but in the display i couldnt see the cursor and if i enter anything in the keyboard, the display will not show that character. Can you please tell me some ideas or refer me some articles? Thanks in advance.

    Regards, Ram

    _ M D 3 Replies Last reply
    0
    • R Ram Murali

      Hi all, I would like to create single document interface something like notepad. Now my problem is i created the basic display. but in the display i couldnt see the cursor and if i enter anything in the keyboard, the display will not show that character. Can you please tell me some ideas or refer me some articles? Thanks in advance.

      Regards, Ram

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Ram Murali wrote:

      Now my problem is i created the basic display

      Did you create an Edit/Richedit control on your window?

      Ram Murali wrote:

      the display will not show that character.

      It's the window of the application that you create. You would need a richedit control or an edit box to start typing the text as we do it in notepad. Here's the code for you: In your Window Procedure you can create two variables as follows: // Global Variables static HWND hWndEdit; static POINT pt; In the WM_CREATE message:OnCreate() of SDI Application. hWndEdit =CreateWindow("EDIT","",WS_CHILD|WS_VISIBLE|WS_BORDER, 0,0,pt.x,pt.y,**m_hWnd**,NULL/*(HMENU)IDC_EDIT1*/, GetModuleHandle(NULL),0); // Remove WS_BORDER if you don't need a border on the edit window to show in WM_SIZE: (OnSize() of the SDI Application) pt.x=LOWORD(lParam); //use cx in SDI instead of LOWORD(lParam) pt.y =HIWORD(lParam);// use cy in SDI instead of HIWORD(lParam); MoveWindow (hWndEdit,0,0,pt.x,pt.y,true); This is for WIN32 application. You can apply the same logic for MFC Application. And now you can compile and run the application and type something in the window that we just created. I hope this helps. -- modified at 4:24 Thursday 28th September, 2006

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      R 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        Ram Murali wrote:

        Now my problem is i created the basic display

        Did you create an Edit/Richedit control on your window?

        Ram Murali wrote:

        the display will not show that character.

        It's the window of the application that you create. You would need a richedit control or an edit box to start typing the text as we do it in notepad. Here's the code for you: In your Window Procedure you can create two variables as follows: // Global Variables static HWND hWndEdit; static POINT pt; In the WM_CREATE message:OnCreate() of SDI Application. hWndEdit =CreateWindow("EDIT","",WS_CHILD|WS_VISIBLE|WS_BORDER, 0,0,pt.x,pt.y,**m_hWnd**,NULL/*(HMENU)IDC_EDIT1*/, GetModuleHandle(NULL),0); // Remove WS_BORDER if you don't need a border on the edit window to show in WM_SIZE: (OnSize() of the SDI Application) pt.x=LOWORD(lParam); //use cx in SDI instead of LOWORD(lParam) pt.y =HIWORD(lParam);// use cy in SDI instead of HIWORD(lParam); MoveWindow (hWndEdit,0,0,pt.x,pt.y,true); This is for WIN32 application. You can apply the same logic for MFC Application. And now you can compile and run the application and type something in the window that we just created. I hope this helps. -- modified at 4:24 Thursday 28th September, 2006

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        R Offline
        R Offline
        Ram Murali
        wrote on last edited by
        #3

        I didnt create anything. I jus followed the MFC wizard to create a single document interface. thatsall. after that i didnt do anything. the output of my design is same as NOTEPAD, But i dont get the blinking cursor and if i press any key in the keyboard, its not displayed in the Notepad text area. ( I am trying to create a application same as notepad in window).

        Regards, Ram

        _ 1 Reply Last reply
        0
        • R Ram Murali

          I didnt create anything. I jus followed the MFC wizard to create a single document interface. thatsall. after that i didnt do anything. the output of my design is same as NOTEPAD, But i dont get the blinking cursor and if i press any key in the keyboard, its not displayed in the Notepad text area. ( I am trying to create a application same as notepad in window).

          Regards, Ram

          _ Offline
          _ Offline
          _AnsHUMAN_
          wrote on last edited by
          #4

          I have provided a basic logic. You can build on this. You can also take a rich edit control instead of the edit window as I do.

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          R 1 Reply Last reply
          0
          • _ _AnsHUMAN_

            I have provided a basic logic. You can build on this. You can also take a rich edit control instead of the edit window as I do.

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

            R Offline
            R Offline
            Ram Murali
            wrote on last edited by
            #5

            Sorry, I dont find any link or information in your previous post.

            Regards, Ram

            _ W 2 Replies Last reply
            0
            • R Ram Murali

              Sorry, I dont find any link or information in your previous post.

              Regards, Ram

              _ Offline
              _ Offline
              _AnsHUMAN_
              wrote on last edited by
              #6

              Ram Murali wrote:

              Sorry, I dont find any link or information in your previous post.

              Can't you see the code in my first post to this thread.:doh: See the post that I have modified.

              Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

              R 2 Replies Last reply
              0
              • R Ram Murali

                Sorry, I dont find any link or information in your previous post.

                Regards, Ram

                W Offline
                W Offline
                Waldermort
                wrote on last edited by
                #7

                Ram Murali wrote:

                Sorry, I dont find any link or information in your previous post.

                Perhaps you should read his post again. Unless my eyes are deceiving me he gave you some example code for what you needed to do, aswell as advice on things you can do.

                1 Reply Last reply
                0
                • _ _AnsHUMAN_

                  Ram Murali wrote:

                  Sorry, I dont find any link or information in your previous post.

                  Can't you see the code in my first post to this thread.:doh: See the post that I have modified.

                  Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                  R Offline
                  R Offline
                  Ram Murali
                  wrote on last edited by
                  #8

                  ya, sorry i saw ur code snippet and trying to execute it. But got so many errors. i am trying to debug it. anyway thanx for ur help.

                  Regards, Ram

                  1 Reply Last reply
                  0
                  • _ _AnsHUMAN_

                    Ram Murali wrote:

                    Sorry, I dont find any link or information in your previous post.

                    Can't you see the code in my first post to this thread.:doh: See the post that I have modified.

                    Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                    R Offline
                    R Offline
                    Ram Murali
                    wrote on last edited by
                    #9

                    May i know what is this lparam in the code? the compiler showing error on lparam as a undefined identifier. thanks.

                    Regards, Ram

                    _ 1 Reply Last reply
                    0
                    • R Ram Murali

                      May i know what is this lparam in the code? the compiler showing error on lparam as a undefined identifier. thanks.

                      Regards, Ram

                      _ Offline
                      _ Offline
                      _AnsHUMAN_
                      wrote on last edited by
                      #10

                      Ram Murali wrote:

                      the compiler showing error on lparam as a undefined identifier.

                      instead of (LOWORD)lParam ; //use cx instead of (HIWORD)lParam ; //use cy Sorry to say but even you should give it a try to sort these kind of errors. I already have modified my post to say this that what you need to place instead of the above two lines....

                      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                      R 1 Reply Last reply
                      0
                      • _ _AnsHUMAN_

                        Ram Murali wrote:

                        the compiler showing error on lparam as a undefined identifier.

                        instead of (LOWORD)lParam ; //use cx instead of (HIWORD)lParam ; //use cy Sorry to say but even you should give it a try to sort these kind of errors. I already have modified my post to say this that what you need to place instead of the above two lines....

                        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                        R Offline
                        R Offline
                        Ram Murali
                        wrote on last edited by
                        #11

                        sorry to disturb u again. after i change and execute it again i got this error. error C2661: 'MoveWindow' : no overloaded function takes 6 parameters may i noe wats this?

                        Regards, Ram

                        _ 1 Reply Last reply
                        0
                        • R Ram Murali

                          sorry to disturb u again. after i change and execute it again i got this error. error C2661: 'MoveWindow' : no overloaded function takes 6 parameters may i noe wats this?

                          Regards, Ram

                          _ Offline
                          _ Offline
                          _AnsHUMAN_
                          wrote on last edited by
                          #12

                          Ram Murali wrote:

                          'MoveWindow' : no overloaded function takes 6 parameters

                          Use ::MoveWindow(/*parameter's go here*/);

                          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                          R W 2 Replies Last reply
                          0
                          • _ _AnsHUMAN_

                            Ram Murali wrote:

                            'MoveWindow' : no overloaded function takes 6 parameters

                            Use ::MoveWindow(/*parameter's go here*/);

                            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                            R Offline
                            R Offline
                            Ram Murali
                            wrote on last edited by
                            #13

                            Wowwwwwwwww thats gr8. its working perfectly now. thanx a lot for ur help.:-D

                            Regards, Ram

                            H 1 Reply Last reply
                            0
                            • _ _AnsHUMAN_

                              Ram Murali wrote:

                              'MoveWindow' : no overloaded function takes 6 parameters

                              Use ::MoveWindow(/*parameter's go here*/);

                              Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                              W Offline
                              W Offline
                              Waldermort
                              wrote on last edited by
                              #14

                              But that gives me an error 'Use' : is not a class or namespace name :laugh:

                              _ H 2 Replies Last reply
                              0
                              • W Waldermort

                                But that gives me an error 'Use' : is not a class or namespace name :laugh:

                                _ Offline
                                _ Offline
                                _AnsHUMAN_
                                wrote on last edited by
                                #15

                                waldermort wrote:

                                But that gives me an error

                                :->That's just great....

                                Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                                1 Reply Last reply
                                0
                                • R Ram Murali

                                  Wowwwwwwwww thats gr8. its working perfectly now. thanx a lot for ur help.:-D

                                  Regards, Ram

                                  H Offline
                                  H Offline
                                  Hamid Taebi
                                  wrote on last edited by
                                  #16

                                  I think that you can find a good example on MSDN examples(Im not sure but I think its in VC6.0)


                                  WhiteSky


                                  1 Reply Last reply
                                  0
                                  • W Waldermort

                                    But that gives me an error 'Use' : is not a class or namespace name :laugh:

                                    H Offline
                                    H Offline
                                    Hamid Taebi
                                    wrote on last edited by
                                    #17

                                    you can use without use:)


                                    WhiteSky


                                    1 Reply Last reply
                                    0
                                    • R Ram Murali

                                      Hi all, I would like to create single document interface something like notepad. Now my problem is i created the basic display. but in the display i couldnt see the cursor and if i enter anything in the keyboard, the display will not show that character. Can you please tell me some ideas or refer me some articles? Thanks in advance.

                                      Regards, Ram

                                      M Offline
                                      M Offline
                                      Maximilien
                                      wrote on last edited by
                                      #18

                                      in the wizard, did you select the CEDitView as the view ? or did you simply kept the defaut CView ?


                                      Maximilien Lincourt Your Head A Splode - Strong Bad

                                      1 Reply Last reply
                                      0
                                      • R Ram Murali

                                        Hi all, I would like to create single document interface something like notepad. Now my problem is i created the basic display. but in the display i couldnt see the cursor and if i enter anything in the keyboard, the display will not show that character. Can you please tell me some ideas or refer me some articles? Thanks in advance.

                                        Regards, Ram

                                        D Offline
                                        D Offline
                                        David Crow
                                        wrote on last edited by
                                        #19

                                        What class did you derive your view from?


                                        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                                        "Judge not by the eye but by the heart." - Native American Proverb

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • World
                                        • Users
                                        • Groups