CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2019
    Posts
    4

    Post C MDI Editor using RichEdit

    Hello,

    I am creating a C program that makes a MDI Editor using RichEdit.
    Actually the program runs and offer many options.
    I would like to improve it adding :

    -Indentation
    -Bookmarks
    -Syntax coloring
    -Compile/Build options

    For the instant I am working on the indentation. My idea is to catch (MSGFILTER) the return key and to add the a number of leadind spaces or tabs that the previous line had. The problem is how to create a new line when the return key is pressed?

    The program runs under Windows

    Could you help me?

    myEditor

    Archive compressed using 7zip.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,417

    Re: C MDI Editor usin RichEdit

    Please, attach your archive to your post.
    Also check it out: Announcement: Before you post...
    Victor Nijegorodov

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,417

    Re: C MDI Editor usin RichEdit

    Quote Originally Posted by Grincheux View Post
    Hello,

    I am creating a C program that makes a MDI Editor using RichEdit.
    ...
    Is it an MFC project? Or plain Win32 one?
    Victor Nijegorodov

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,861

    Re: C MDI Editor usin RichEdit

    The problem is how to create a new line when the return key is pressed?
    For the current child form, the portion of the text to be displayed is shown starting from window position 0,0. A newline in the text simply means that the row position within the window is advanced and the column position set to 0. The row position is also advanced when a line is too long to be displayed using the window width etc. So when the CR key is pressed, insert a new line into the text and advance the row positon by 1 and set the column position to 0.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5
    Join Date
    Nov 2019
    Posts
    4

    Re: C MDI Editor usin RichEdit

    I cannot use VS, because it is too much expensive. The compiler I use is a very good one. All my programs and source code and everyone can use it as he wants. There is no kind of licence, it is free that's all. I make the program when I have no work, I am a freelance, and programming is a passion. I saw many examples of MDI and RichEdit but they just showed Open/Close/Cut and Paste... that's poor. It was written keeping in mind that other programmers could find a complete exemple. I have to add the options described above and the possibility to compile. A kind of IDE. Don't forget it's just for fun.
    Last edited by Grincheux; December 7th, 2019 at 02:09 PM.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: C MDI Editor usin RichEdit

    Quote Originally Posted by Grincheux View Post
    I cannot use, because it is too much expensive. The compiler I use is a very good one.
    What is too expensive?

  7. #7
    Join Date
    Nov 2019
    Posts
    4

    Re: C MDI Editor usin RichEdit

    I know there is the community edition, but that's not a complete IDE, no resources editor. Always use of spaghetti code for programs... The advantages or disavantages of MS Compiler is not the purpose. My problem is about my MDI Editor. My model is Notepad++, but in Notepad++, it seems hard to setup a compiler. I know, there is Code Blocks, the answer is the same and I don't want to use gcc. So there was only one solution, I have to write my own IDE. Why not? The program must be able to speak many languages. The only thing I refuse to do is to include support for RTL languages.

    Now I will write the indentation code. I don't want to use the PARAMFORMAT structure because I want the indentation exists even if the source code is read by an other editor. I think I must trap the WM_KEYDOWN message for VK_ENTER and/or VK_RETURN.I have not again understood how that could be done. I think that I could directly address the buffer at the next line, (2kaud explications).

  8. #8
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,861

    Re: C MDI Editor using RichEdit

    I know there is the community edition, but that's not a complete IDE, no resources editor.
    VS2019 Community Edition is fully-featured. The only real difference between the 2019 Community Version and the Professional Edition is the licensing. Have you tried VS2019 Community? Give it a go if you haven't! Note that the default install options are not suitable for developing with C++. You'll need to select for install the necessary C++ options.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  9. #9
    Join Date
    Nov 2019
    Posts
    4

    Post Re: C MDI Editor using RichEdit

    Quote Originally Posted by 2kaud View Post
    VS2019 Community Edition is fully-featured. The only real difference between the 2019 Community Version and the Professional Edition is the licensing. Have you tried VS2019 Community? Give it a go if you haven't! Note that the default install options are not suitable for developing with C++. You'll need to select for install the necessary C++ options.
    I will take a look at VS Community 2019.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured