473,383 Members | 1,788 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,383 software developers and data experts.

Detecting resources not being released from com extension

I've developed a com extension for explorer and another dll linked to
the com extension which provides the actual functionality. The
extension does nothing more than create an object and pass selected
files to the object for further processing. The problem I'm running
into is with a few cases resources do not seem to be properly
released. For example, I can remove all of the files in the given
folder where the shell extension was used but I cannot remove the
folder itself because it is still in use by some process. I'm having
trouble tracking down what's being left in memory, running or what
have you that is occupying the folder. My question is are there any
tools or methods I can use to track down what's not being released
under this scenario (a com shell extension and a dll all written in
c#)?

Thanks,
J.P.

P.S. I've tried monitoring a given folder with utilities like
SysInternal's FileMon, I'm not finding any useful information there
linking me back to the com extension.

Jun 19 '07 #1
1 1188
On Jun 19, 10:39 am, "J.P." <jptroscl...@gmail.comwrote:
I've developed a com extension for explorer and another dll linked to
the com extension which provides the actual functionality. The
extension does nothing more than create an object and pass selected
files to the object for further processing. The problem I'm running
into is with a few cases resources do not seem to be properly
released. For example, I can remove all of the files in the given
folder where the shell extension was used but I cannot remove the
folder itself because it is still in use by some process. I'm having
trouble tracking down what's being left in memory, running or what
have you that is occupying the folder. My question is are there any
tools or methods I can use to track down what's not being released
under this scenario (a com shell extension and a dll all written in
c#)?

Thanks,
J.P.

P.S. I've tried monitoring a given folder with utilities like
SysInternal's FileMon, I'm not finding any useful information there
linking me back to the com extension.
After further digging I have found the cause of the problem. The issue
has only occurred with objects that create and use the SaveFileDialog,
to confirm this I commented the SaveFileDialog code in one of the
offending objects and tested it multiple times to make sure the
directory could in fact be deleted. The problem has not happened
since. I would prefer to keep the SaveFileDialog, so what I've tried
at this point is calling the .Dispose() member, assigning null to the
object and calling GC.Collect(). This does not solve the problem. Here
is the actual code being executed:

SaveFileDialog sfd = new SaveFileDialog();

sfd.InitialDirectory = m_Directory;
sfd.Title = "Document Save";
sfd.Filter = "*.pdf|*.pdf";
sfd.FileName = "combined_document.pdf";
if (sfd.ShowDialog(this) != DialogResult.OK) {
sfd = null;
GC.Collect();
this.Close();
return;
}

try {
if (File.Exists(sfd.FileName)) {
File.Delete(sfd.FileName);
}
}
catch (Exception ex) {
ShowError(ex.Message, "PdfTool: Error removing
existing file");
this.Close();
return;
}

m_outFile = sfd.FileName;
sfd.Dispose();
sfd = null;
GC.Collect();

Jun 19 '07 #2

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

Similar topics

2
by: sunyour | last post by:
PHP 5.0.0 Released! The PHP team is proud to announce the final release of PHP 5! Some of the key features of PHP 5 include: The Zend Engine II with a new object model and dozens of new...
3
by: Tony Johansson | last post by:
Hello experts!! I reading in a book about C++ and there is something that I'm not sure about. I don't belive that the book is wrong but I will just ask you out there what you think. The book...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
1
by: D. Yates | last post by:
Hi, I am looking for an example of how to extract bitmap images from an embedded resource file (a file with *.res extension, which can be viewed inside of the ide and can hold bitmaps, icons,...
3
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
7
by: Nathan Sokalski | last post by:
I want to make sure I am doing a browser detection that will work once IE7 is released. My current detection statement (written using VB.NET) is: If Me.Request.Browser.Browser.ToUpper() = "IE"...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
9
by: shir | last post by:
hi.. i need help with this program. this is a program to turn 'ON' and 'OFF' 1 LED using 2 push buttons. the underline statement suppose to wait for button press. but it is alway false even i have...
8
by: Varangian | last post by:
Hello, was wondering of how to dispose of managed resources? or referencing every member of a class to null will release resources...? http://www.marcclifton.com/tabid/79/Default.aspx...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.