Click here to Skip to main content
Click here to Skip to main content

kPad - A lightweight WTL based text editor

By , 5 Aug 2000
 
  • Download source files - 79 Kb
  • Download demo project - 52 Kb
  • Sample Image - kPad.gif

    Introduction

    kPad is a lightweight text editor that works with RTF and TXT file formats.

    It's an example of using the WTL library and RichEdit control, and is based on the MTPad sample from the Microsoft SDK (12/01/99).

    Features

    • Sheets control
    • Find and Replace custom dialogs
    • Small size (104 Kb)

    Implementation

    With the help of the ATL\WTL AppWizard I created a "Multiple Threads SDI" project with a generic view window. The class SheetsCtrl is a view window for the Main Frame and a container for kSheetView child windows. kSheetView is a superclass of the RichEdit control.

    The small size of 105 Kb is achieved by removing the dependancy on the CRT library (_ATL_MIN_CRT) and use the project options /OPT:REF, /OPT:ICF, /OPT:NOWIN98.

    Environment

    This application was created with VC 6.0. SP3, WTL and the January MS SDK. It has been tested only on W2k.

    Acknowledgments

    WTL Sites References

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Konstantin Boukreev
    Web Developer
    Russian Federation Russian Federation
    Member
    I am freelance programmer. About 3 years of experience in C++ and I would rather use ATL, STL, WTL but not MFC Smile | :) . Main backgrounds are Win32 API, COM and Networking. Now I am interested about AI (Neural Network, Fuzzy Logic and GA). Currently based in Vladivostok, Russia.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    GeneralBuilding with WTL 7.1 / VS.NET 2003memberMatt Bishop12 May '04 - 11:26 
    Thanks for a fantastic app!
     
    To get the source to build on WTL7.1 with Visual Studio.NET 2003, change the following lines to:
     
    mainfrm.h(241): UISetCheck(ID_VIEW_TOOLBAR, (BOOL)m_bShowToolBar);
    mainfrm.h(242): UISetCheck(ID_VIEW_FORMAT, (BOOL)m_bShowFormatBar);
    mainfrm.h(243): UISetCheck(ID_VIEW_STATUS_BAR, (BOOL)m_bShowStatusBar);
    mainfrm.h(466): UISetCheck(ID_VIEW_TOOLBAR, (BOOL)m_bShowToolBar);
    mainfrm.h(478): UISetCheck(ID_VIEW_FORMAT, (BOOL)m_bShowFormatBar);
    mainfrm.h(487): UISetCheck(ID_VIEW_STATUS_BAR, (BOOL)m_bShowStatusBar);
     
    This will prevent an error occuring due to the ambiguous call to UISetCheck.
     
    And remove:
     
    stdafx.cpp(7): #include <atlimpl.cpp>
     
    This will remove the atlimpl.cpp warning.
     
    [edit]You could wrap this line in an #if to test if the version is less than 7.0, but I'm just plain lazy...
    i.e.
     
    #if (_ATL_VER < 0x0700)
    #include <atlimpl.cpp>
    #endif //(_ATL_VER < 0x0700)
     
    Oh, and don't forget to add #define OEMRESOURCE to stdafx.h!
     
    [/edit]
     
    Hope that helps someone!
     
    Matt

     
    "If we knew what it was we were doing, it would not be called research, would it?"
    - Albert Einstein

    GeneralRe: Building with WTL 7.1 / VS.NET 2003member089890882 Mar '08 - 19:30 
    you just help me.thanks. Big Grin | :-D
    GeneralT_SafeVector.h missingmemberleonqiu19 Feb '04 - 6:34 
    I got this error when compiling:
    D:\project\2FindToolbar\utils.cpp(7) : fatal error C1083: Cannot open include file: 'T_SafeVector.h': No such file or directory
     
    Thanks for your great work.
    Wink | ;)
    GeneralRe: T_SafeVector.h missingsussnarendr30 Jun '04 - 12:59 
    Hi
    I get the same error. Did you resolve it?
     
    thanks
    nat
    GeneralOLE supportmemberVolkerB1 Feb '03 - 11:00 
    A great article !
     
    A suggestion for further development is the OLE support.
    See "SAMPLE: RichEdit.exe - Inserts OLE Object Capabilities" Q141549
     
    http://download.microsoft.com/download/platformsdk/sample53/1/W95/EN-US/RichEdit.exe
     
    I included the OLE classes into my own WTL project. Some adaptions and it works reasonably, but it's not perfectly yet.
     

    QuestionWhen we program with WTL, can we use STL?sussAnonymous20 Sep '02 - 7:22 
    WTL has any support like "CArray" or "deque"?
     
    Thank you!
     
    geanz@963.net
    AnswerRe: When we program with WTL, can we use STL?memberTim Smith20 Sep '02 - 8:01 
    Yes, you can still use STL. ATL7/WTL7 CArray support is much imporved. Much less code bloat than STL. 3-4k per instance of a std::vector for example.
     
    However, I had no problem using STL and WTL in my last project.
     
    Tim Smith
     
    "Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
    Hoare - 1980 ACM Turing Award Lecture
    GeneralGdiGradientFill entry point not found..memberWayne Davis15 May '02 - 1:46 
    I've seen KPAD work perfectly on Windows 2000, but I'm stuck with NT4.0 SP6 for at least another month or two. Compiling with VC 6 is no problem thanks to the latest SDK but I'm having a run-time error JUST on NT.
     
    The error message says:
    "The procdure entry point GdiGradientFill could not be located in the dynamic link library GDI32.dll"
     
    I tried updateing GDI32.dll but it's locked by Windows and can not be accessed. I also tried adding GDI32.lib to the kpad project in hope of eliminating the need for the dll with no success.
     
    Does anyone know of a way to get around this error?Confused | :confused:
    GeneralRe: GdiGradientFill entry point not found..sussAnonymous8 Aug '02 - 14:06 
    私も同じ現象が出ています。誰か解決方法を教えて下さい。 Dead | X|
    Generalatlres.h not in source codememberKyung Bae Park9 May '02 - 15:09 
    Hi!
     
    atlres.h file not in source code.
    please send me atlres.h
     
    thanks.

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web04 | 2.6.130523.1 | Last Updated 6 Aug 2000
    Article Copyright 2000 by Konstantin Boukreev
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid