473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Closing File Handles

Hi,
I am new to coding in Windows. I need to know if its
possible to close all the handles open (If there are any)
to a particular file. The assumption here is that, I do
not know if there is any handle open to the file or not.
Since I do not have access to a project, I have to handle
this in my part of the code. If it is possible to close
all the open handles to a file, please point me to some
kind of documentation or something which can guide me.
Thanks
Kangan
Nov 17 '05 #1
1 2537
> I am new to coding in Windows. I need to know if its
possible to close all the handles open (If there are any)
to a particular file.


Assume its not.

Some system dependent low-level tools may be able to do it, but you
shouldn't design your application that way. Some other process has
presumably got the file open for a reason, and you'll be breaking it.

You should code your application to cater for the situation gracefully
- if possible.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: flupke | last post by:
Hi, I have a gui (made in wxPython) that enables a user to connect to a server and issue some commands. The problem occurs when i try to disconnect the client. It exits but it doesn't return to...
2
by: Peter Schmitz | last post by:
Hi, I've got the following problem: My current project consists of several clients and all of them use(read) a file, that is placed on a shared hard disk on one of my file servers (windows2k)....
3
by: ThunderMusic | last post by:
Hi, I'm trying to have a MSN Messenger like form/app closing behavior. When I click on the X button, I only want the form to disappear and when I double-click on the notify icon or right-click...
4
by: Amalorpavanathan Y \(Amal\) | last post by:
Hi All, In Winform Application, MDI form is having Save button. When i close the application, it will ask Save Changes? YES or NO or CANCEL. after i select CANCEL button, i have set e.Cancel =...
3
by: Daniel Sélen Secches | last post by:
Hi all I want to do in my application something like we have on ICQ. when you close the application it doesn't close. I've done like that Private Sub Form1_Closing(ByVal sender As Object,...
2
by: chris in grimsby | last post by:
MDIChild Window Closing event not raised when MDI Parent is in a class library! Intructions to recreate problem: 1. Create a ClassLibrary project 2. Add an MDIParent form and a form that will...
1
by: e_man_online | last post by:
Hi, I have a VStudio 2003 project that had code like: Private Sub frmAnyForm_Closing(<parameters list...>) Handles MyBase.Closing and this project was converted to .NET 2.0 Everything...
3
by: Carroll, Barry | last post by:
Greetings: Please forgive me if this is the wrong place for this post. I couldn't find a more acceptable forum. If there is one, please point me in the right direction. I am part of a small...
3
by: sewid | last post by:
Hi! I have a very simple windows form (Visual Basic, .NET-Framework 2.0). This is my whole code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.