Thread: WIN32 API: RichEdit control RTF data size

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    2

    WIN32 API: RichEdit control RTF data size

    I want to copy the content of a richedit control to a buffer.You know the text in the richedit have format.I want to copy both the text and its format.

    First I need to allocate the buffer,so I need to know the size of the formatted text.I know I can use the GetWindowText() to get the text length.But it's only the text length,I need to get the format data length also.I failed to find such a function which can help me getting the data size.

    How can I get the size?

    If it's impossible,maybe I'll save the formatted text to a RTF file first and then get its length as the size of my buffer.It's not a good way.So I wish your help.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Hi, there is code to load and save a rich edit control.

    I'm not aware of a way to get the required buffer size in advance. Probably, the best option is to use a resizable array, such as std::vector in C++, or malloc/realloc in C.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    2
    thank you very much.Next time I'll search before create a new post.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Win32 API tooltip control
    By wind_addict in forum Windows Programming
    Replies: 1
    Last Post: 05-12-2008, 06:16 AM
  2. Win32 API - Group Box Control
    By Matt-Stevens in forum Windows Programming
    Replies: 2
    Last Post: 09-05-2006, 08:46 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Determining Data Size For Network Send/Rec :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 6
    Last Post: 05-07-2002, 09:01 PM