none
Superpad or Multipad sample

    Question

  • Simple question...

    Once you load a file in this sample, how do you get access to the text in the file you have opened one line at a time?

    I know about getWindowText for controls but that is not much good for an MDI situation where there could be kbytes of file data.

    Tuesday, February 09, 2016 3:30 PM

All replies


  • I know about getWindowText for controls but that is not much good for an MDI situation where there could be kbytes of file data.

    What do you mean? The text of the control is already loaded into memory, no matter what the size. You can call GetWindowText to fetch the pointer to the beginning of this memory. If you only want to scan one line, search for "\r\n".
    Tuesday, February 09, 2016 4:22 PM

  • I know about getWindowText for controls but that is not much good for an MDI situation where there could be kbytes of file data.

    What do you mean? The text of the control is already loaded into memory, no matter what the size. You can call GetWindowText to fetch the pointer to the beginning of this memory. If you only want to scan one line, search for "\r\n".

    1) Is GetWindowText() going to work with the MDI architecture. I know it will work on a control after GetDlgItem(...), but I am not so sure it will from CMainFrame.

    2) If the file contains 1MB of text and I call GetWindowText() then I seriously doubt that I am going to be able to put it in a CString and then search for "\r\n". Correct me if I am wrong here.

    Gawd there must be some way of getting at the data structure inside CMainFrame or CPadDoc that contains the text read from the file.

    Wednesday, February 10, 2016 2:57 AM
  • Hi Gregary,

    This forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    Please tell me which project type you are using which can let me help you move this thread to a applicable forum for a better help.

    Best Regards,
    Weiwei

    Thursday, February 11, 2016 10:26 AM
    Moderator