473,771 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DSOFILE and Interop Issues

Hi All:

I need some help. I am using DSOFile.exe to examine and add and/or
manipulate some document and custom properties on a JPEG file. When the
document properties are correct, I would like to copy or move the modified
file to a new location. The problem that I am having is that the modified
file is somehow being held in memory and not being released. I use the
following code to read in the file:

Try
oFilePropReader = New DSOleFile.Prope rtyReader
oDocProp = oFilePropReader .GetDocumentPro perties(txt_Fil eLoc.Text)
Try
If Not oDocProp.AppNam e.ToString Is Nothing Then
lstNormalProps. Items.Add("AppN ame: " & oDocProp.AppNam e.ToString)
Catch ex As Exception
Err.Clear()
End Try
.........
Catch ex As Exception
MsgBox(ex.Messa ge & " Please choose another file.", Page)
Err.Clear()
End Try

This part all works fine... then to release the file from memory I use the
following code...

If Not oDocProp Is Nothing Then
System.Runtime. InteropServices .Marshal.Releas eComObject(oDoc Prop)
oDocProp = Nothing
GC.Collect()
End If
If Not oFilePropReader Is Nothing Then
System.Runtime. InteropServices .Marshal.Releas eComObject(oFil ePropReader)
oFilePropReader = Nothing
GC.Collect()
End If

So far...so good.. the file is released from memory and I can move or copy
it with no problem... Where the problem exists is when I review the
CustomDocumentP roperties...usi ng the following code...

Try
oFilePropReader = New DSOleFile.Prope rtyReader
oDocProp = oFilePropReader .GetDocumentPro perties(txt_Fil eLoc.Text)
Try
If Not oDocProp.AppNam e.ToString Is Nothing Then
lstNormalProps. Items.Add("AppN ame: " & oDocProp.AppNam e.ToString)
Catch ex As Exception
Err.Clear()
End Try
.........
For Each oCustProp In oDocProp.Custom Properties
sTmp = oCustProp.Name & ": " & CStr(oCustProp. Value)
lstNormalProps. Items.Add("Cust om Property: " & sTmp)
Next
Catch ex As Exception
MsgBox(ex.Messa ge & " Please choose another file.", Page)
Err.Clear()
End Try

Then nothing I have done seems to get the file to be released... Does anyone
have any suggestions...o r ideas ... or code snippets??? Thank you for your
timely advice.
--

Best regards

Paul Perot
President
Perot Solutions
Pa*******@Perot Solutions.com
(770) 565 - 9151
(678) 852 - 7789 (c)
Nov 18 '05 #1
0 1143

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

Similar topics

0
1714
by: | last post by:
I am using Microsoft's dsofile (http://support.microsoft.com/support/kb/articles/Q224/3/51.asp) in an ASP to update a set of custom properties in a Word document. The document properties are always correctly updated after running the script on the ASP. However, after running the ASP for the second or third time IIS will lock and will fail to respond to any request until I restart IIS or get some error (note that the error is not always the...
14
8737
by: Curtis Tammany | last post by:
Hello- Can someone tell me if DSOFile.dll can be accessed within ASP.NET? DSOFile.dll is registered and I have no problem using it in my .ASP scripts. I have tried the following: Dim oFilePropReader As DSOleFile.PropertyReader Dim oFileProperties As oFilePropReader.GetDocumentProperties("C:\MyDoc.doc") Response.write ("<table>" & vbCRLF) Response.write ("<tr><td><B>Title: </B></td><td>" & oFileProperties.Title & "</td></tr>" &...
0
1619
by: Nautilus | last post by:
I am writing an application in ASP.Net which generates a list of files from a shared network folder using DirectoryInfo class and then I use the wonderful control, <a href="http://support.microsoft.com/? kbid=224351">DSOFile.dll</a>, provided by Microsoft to gather the document properties like Author, Title etc and show along with file list. I can generate the file list from shared network folder but I am not able to read the document...
0
1303
by: Curtis Tammany | last post by:
To Microsoft: For the next release of .NET framework, can you please include the functionality of DSOFile.dll??? Trying to implement DSOFile in .NET and get all the extended properties including its icon and thumbnail are extremely hard (if not impossible). Thanks- Curtis Tammany
3
1672
by: Bill Alexander | last post by:
I'm having trouble with updating general fields (Title, Autor Suject, etc.) in the summary of documents located on our Intranet. I've downloaded the FilePropDemoVB7 example (http://support.microsoft.com/?kbid=224351) and even tried modifing it to make the changes to my local files and I get the same error on both the original and the ASP.net version. Here is an example of my code that's tring to make a change: Private Sub...
4
11161
by: Paul Bromley | last post by:
I have been pondering over this one all night!! I want to read the properties of a Word document WITHOUT opening it - notably the title document. Having read the newsgroups it seems that I neede to download from the MS site the DSOFile package containing the said DLL. However on looking in the newsgroups the best option to me seems to be using the DSOleFile.PropertyReader and then the GetDocumentProperties property, but this seems to be...
0
1351
by: aschurg | last post by:
This post is in regard to archived discussion: http://www.thescripts.com/forum/thread103110.html Here is important information about dsofile.dll from an ASP.NET 2.0 application with regard to access rights/file security: I ran into security access violations when I tried to access a file on a network share using impersonation and read the summary properties using dsofile.dll. It turns out that COM components (such as dsofile.dll)...
2
5712
by: sanjay1983 | last post by:
Hi Everyone, I am stuck to access file properties using 'Interop.dsofile.dll'. I dont want registration of this assembly in system registry. I am using reflection to achive this, but at the time of create instance (Activator.CreateInstance) of 'dsofile.OleDocumentPropertiesClass' it throw the following registry exception: "Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.