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. How To Save Data for Microsoft Word 2007 or 2010 on Windows OS

How To Save Data for Microsoft Word 2007 or 2010 on Windows OS

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformance
7 Posts 2 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.
  • T Offline
    T Offline
    Thong LeTrung
    wrote on last edited by
    #1

    Hi ,all, When I open a .txt file .I think Notepad will call NtReadFile function . If I modify content .txt file and then I save txt file . I think Notepad will call Notepad will call NtWriteFile function . My question : When I open .txt file ,and next I choose "save as" . How many functions does Notepad call to be "save as" ? Will Data store on buffer or hard disc before we choose "save as "? How many functions does "Microsoft Word" call when we choose "save as" ? I think in the case "Microsoft Word" will use memory mapped file to be " save as" Thanks Thong Le Trung

    E 1 Reply Last reply
    0
    • T Thong LeTrung

      Hi ,all, When I open a .txt file .I think Notepad will call NtReadFile function . If I modify content .txt file and then I save txt file . I think Notepad will call Notepad will call NtWriteFile function . My question : When I open .txt file ,and next I choose "save as" . How many functions does Notepad call to be "save as" ? Will Data store on buffer or hard disc before we choose "save as "? How many functions does "Microsoft Word" call when we choose "save as" ? I think in the case "Microsoft Word" will use memory mapped file to be " save as" Thanks Thong Le Trung

      E Offline
      E Offline
      Erudite_Eric
      wrote on last edited by
      #2

      It will call NtCreeateFile to change the name. As for the file itself, it will be in memoery generally unless it is so big it gets paged out or read in in chunks.

      T 1 Reply Last reply
      0
      • E Erudite_Eric

        It will call NtCreeateFile to change the name. As for the file itself, it will be in memoery generally unless it is so big it gets paged out or read in in chunks.

        T Offline
        T Offline
        Thong LeTrung
        wrote on last edited by
        #3

        Hi,Erudite_Eric, Before I write data , I will hook NtWriteFile function and encrypt content file . Before I read data , I will hook NtReadFile function and decrypt content file to display file My code work well with "Notepad" , but crash with "Microsoft Word" when I choose "save as" I have checked .pdf file , .pdf file still works well . Thank you for your time. Thong Le Trung.

        E 1 Reply Last reply
        0
        • T Thong LeTrung

          Hi,Erudite_Eric, Before I write data , I will hook NtWriteFile function and encrypt content file . Before I read data , I will hook NtReadFile function and decrypt content file to display file My code work well with "Notepad" , but crash with "Microsoft Word" when I choose "save as" I have checked .pdf file , .pdf file still works well . Thank you for your time. Thong Le Trung.

          E Offline
          E Offline
          Erudite_Eric
          wrote on last edited by
          #4

          Well obviously I cant say why your application is crashing.

          T 1 Reply Last reply
          0
          • E Erudite_Eric

            Well obviously I cant say why your application is crashing.

            T Offline
            T Offline
            Thong LeTrung
            wrote on last edited by
            #5

            Function NtCreateFile will call to change the name when we choose "save as" . Do I wonder content new file will have from ? . I think after create new file, it will read File from old file and then it will write data to new file.

            E 1 Reply Last reply
            0
            • T Thong LeTrung

              Function NtCreateFile will call to change the name when we choose "save as" . Do I wonder content new file will have from ? . I think after create new file, it will read File from old file and then it will write data to new file.

              E Offline
              E Offline
              Erudite_Eric
              wrote on last edited by
              #6

              No, it wont do that. The kernel API does exactly what it says it does. If it says it create a file it does, it doesnt copy a file. Believe me, I have spent 16 years writing windows kernel code. --edit-- Oh look a one voter. Well, NtCreateFIle etc is the API you use inside the kernel and I have used it a lot. so mr one voter, ypu are wrong. --edit-- Oh look, another 1 voter. What fun!

              T 1 Reply Last reply
              0
              • E Erudite_Eric

                No, it wont do that. The kernel API does exactly what it says it does. If it says it create a file it does, it doesnt copy a file. Believe me, I have spent 16 years writing windows kernel code. --edit-- Oh look a one voter. Well, NtCreateFIle etc is the API you use inside the kernel and I have used it a lot. so mr one voter, ypu are wrong. --edit-- Oh look, another 1 voter. What fun!

                T Offline
                T Offline
                Thong LeTrung
                wrote on last edited by
                #7

                Hi, Erudite , I graduated about one year so I don't have much experience about Win kernel .Thank you for helping me Thong Le Trung

                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