![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
and the problem is that it is not working with the e.g. CD-ROM - i.e. is not retrieving details of the file (e.g. author, picture size, ...). I read somewhere in the inet that it is because this info is lost when not using NTFS file system, but actually it is not true, because Microsoft Windows Explorer shows the infomation when one select the file and let the explorer display info about the file (yes also for CD-ROM). And in the MSDN docs there is not written anything about such a limitation. Can anyone bring enlightenment for me and save my soul, please? |
|
2) If I use Shell32.Shell shell = new Shell32.ShellClass(); do I have to do any explicit releasing of the COM resources or so? I read somewhere in the inet (there are so many rumors in the inet) that I have to use releasecomobject or something like method to release resources. (can you provide link or explain lifecycle of this, please?) |
#3
| |||
| |||
|
|
and the problem is that it is not working with the e.g. CD-ROM - i.e. is not retrieving details of the file (e.g. author, picture size, ...). I read somewhere in the inet that it is because this info is lost when not using NTFS file system, but actually it is not true, because Microsoft Windows Explorer shows the infomation when one select the file and let the explorer display info about the file (yes also for CD-ROM). And in the MSDN docs there is not written anything about such a limitation. Can anyone bring enlightenment for me and save my soul, please? In order to retrieve metadata (e.g. author, picture size, ...) from a file, you must obtain an IPropertySetStorage interface from the shell. You use the shell method BindToStorage to get this interface. 2) If I use Shell32.Shell shell = new Shell32.ShellClass(); do I have to do any explicit releasing of the COM resources or so? I read somewhere in the inet (there are so many rumors in the inet) that I have to use releasecomobject or something like method to release resources. (can you provide link or explain lifecycle of this, please?) There are two ways to work with COM in .Net. Managed or Unmanaged. In Unmanaged COM, all the rules of COM apply. You are responsible for reference counting and releasing intefaces when you no longer need them. In Managed COM, a runtime callable wrapper is generated for the COM object. The RCW is responsible for reference counting and managing the releasing of the interfaces. The online MSDN documentation explains all the details. The topics worth reviewing include the rules of COM, RCW and System.Runtime.InteropServices. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |