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 lock a file?

How to lock a file?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
2 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.
  • R Offline
    R Offline
    Ralf Friedrich Hain
    wrote on last edited by
    #1

    In CDocument::Serialize I access a .ini-file. All is ready now. But I want to protect the file currently in use from being edited/deteted/moved... with another application. How can I lock the file (like in Word: "The file you want to access is currently in use" (or similar) Can anybody help me? :-| Friedrich

    M 1 Reply Last reply
    0
    • R Ralf Friedrich Hain

      In CDocument::Serialize I access a .ini-file. All is ready now. But I want to protect the file currently in use from being edited/deteted/moved... with another application. How can I lock the file (like in Word: "The file you want to access is currently in use" (or similar) Can anybody help me? :-| Friedrich

      M Offline
      M Offline
      Masaaki Onishi
      wrote on last edited by
      #2

      Hello, the codegurus around the world.;) When we open Word file, another temporary file is created. So, if someone first opens the file and another temporary file is created, the other people don't have the previlege to save this file. Does this work?:confused: Or, move this file to the temporary directory which anyone may not find this file easily? :eek: Have a nice day! -Masaaki Onishi-

      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