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. file is getting deleted

file is getting deleted

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 4 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.
  • S Offline
    S Offline
    sarfaraznawaz
    wrote on last edited by
    #1

    hi, every one i have created the file using the createFile. HANDLE temp_file = CreateFile(sourceFileName,GENERIC_WRITE|GENERIC_READ,/*FILE_SHARE_WRITE|FILE_SHARE_READ*/NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_HIDDEN /*FILE_ATTRIBUTE_NORMAL*/,NULL); in windows vista i have created but its getting deleted in windows 8 and windows xp . what will be the reason . Thanking you Sarfaraz

    S D 2 Replies Last reply
    0
    • S sarfaraznawaz

      hi, every one i have created the file using the createFile. HANDLE temp_file = CreateFile(sourceFileName,GENERIC_WRITE|GENERIC_READ,/*FILE_SHARE_WRITE|FILE_SHARE_READ*/NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_HIDDEN /*FILE_ATTRIBUTE_NORMAL*/,NULL); in windows vista i have created but its getting deleted in windows 8 and windows xp . what will be the reason . Thanking you Sarfaraz

      S Offline
      S Offline
      Sivaraman Dhamodharan
      wrote on last edited by
      #2

      FILE_ATTRIBUTE_HIDDEN . Make sure you can view the hidden files!

      Programming Article

      S 1 Reply Last reply
      0
      • S Sivaraman Dhamodharan

        FILE_ATTRIBUTE_HIDDEN . Make sure you can view the hidden files!

        Programming Article

        S Offline
        S Offline
        sarfaraznawaz
        wrote on last edited by
        #3

        ya i did

        1 Reply Last reply
        0
        • S sarfaraznawaz

          hi, every one i have created the file using the createFile. HANDLE temp_file = CreateFile(sourceFileName,GENERIC_WRITE|GENERIC_READ,/*FILE_SHARE_WRITE|FILE_SHARE_READ*/NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_HIDDEN /*FILE_ATTRIBUTE_NORMAL*/,NULL); in windows vista i have created but its getting deleted in windows 8 and windows xp . what will be the reason . Thanking you Sarfaraz

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          sarfaraznawaz wrote:

          ...but its getting deleted in windows 8 and windows xp .

          Which means it is indeed getting created. At what point does the file get deleted?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          S 1 Reply Last reply
          0
          • D David Crow

            sarfaraznawaz wrote:

            ...but its getting deleted in windows 8 and windows xp .

            Which means it is indeed getting created. At what point does the file get deleted?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            S Offline
            S Offline
            sarfaraznawaz
            wrote on last edited by
            #5

            My application am creating the file.i am calling the exe for the preview of the file after closing the exe the file is getting dleted,its working fine on windows 7 and vista even am not use the delete file API not the exe which am calling has no dletefile API ... what would be the problem ... Best Regards Sarfaraz

            C 1 Reply Last reply
            0
            • S sarfaraznawaz

              My application am creating the file.i am calling the exe for the preview of the file after closing the exe the file is getting dleted,its working fine on windows 7 and vista even am not use the delete file API not the exe which am calling has no dletefile API ... what would be the problem ... Best Regards Sarfaraz

              C Offline
              C Offline
              chaau
              wrote on last edited by
              #6

              Make sure you call ::CloseHandle(temp_file) after you have done working with it

              S 1 Reply Last reply
              0
              • C chaau

                Make sure you call ::CloseHandle(temp_file) after you have done working with it

                S Offline
                S Offline
                sarfaraznawaz
                wrote on last edited by
                #7

                ya i am closing handle, if i not close the handle it unable open it its show the message that its has been in use ... thats not the problem its getting deleted as i close the preview exe... Best Regards sarfaraz

                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