Re: Riddle Me This
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Mon, 14 Jan 2008 22:17:00 +0100
"pbd22" <dushkin@xxxxxxxxx> wrote in message news:64dc2ce2-6d04-4cc7-8cc7-7e744ce9a16a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks again Willy.
I sent you the windows service code to your private email address.
You will see the calling method there (I sent a description in my
email).
Feel free to continue the thread by responding here.
THanks again for all your help!
Peter
Ok, I noticed in another reply that the only thing that gets done by the COM components, is retrieving the metadata from Windows media files (video) and dumping this data to a text file. If this is what you are doing, then there is no reason to use VB6 and COM stuff any longer.
All you should do is declare the IWMHeaderInfo3 and the IWMMetadataEditor COM interfaces (search wmsdkidl.idl in the platform sdk headers) and declare the WMCreateEditor function exported by the WMVCore.dll.
Here the PInvoke declaration and part of the COM interface definitions to get you started.
[DllImport("WMVCore.dll",SetLastError=true,
CharSet=CharSet.Unicode, SuppressUnmanagedCodeSecurity)]
public static extern uint WMCreateEditor(
[Out, MarshalAs(UnmanagedType.Interface)] out IWMMetadataEditor ppMetadataEditor );
// COM interfaces IWMMetadataEditor and IWMHeaderInfo3 (check wmsdkidl.idl in the Platform or the Media SDK headers).
[Guid("96406BD9-2B2B-11d3-B36B-00C04F6108FF"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMMetadataEditor
{
uint Open( [In,MarshalAs(UnmanagedType.LPWStr)] string pwszFilename );
uint Close();
uint Flush();
}
[Guid("15CC68E3-27CC-4ecd-B222-3F5D02D80BD5"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMHeaderInfo3
{
uint GetAttributeCount(
[In] ushort wStreamNum,
[Out] out ushort pcAttributes );
// other IWMHeaderInfo3 methods
.....
Basically what you should do is call the WMCreateEditor API to get a pointer to the IWMMetadataEditor interface.
Once you have this interface, you can call it's Open method to open a media file.
When you cast the IWMMetadataEditor to an IWMHeaderInfo3 interface, you can get the metadata. Methods to call are GetAttributeCountEx and GetAttributeByIndexEx.
When done with the file, you call IWMMetadataEditor Close and quit.
The media API's and COM interfaces can be used from MTA threads, so there is nothing to worry about when used from Service threads.
Willy.
Willy.
.
- Follow-Ups:
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- References:
- Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Michael D. Ober
- Re: Riddle Me This
- From: DeveloperX
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Riddle Me This
- Prev by Date: Security.PrincipalPermission.Demand()
- Next by Date: Re: breaking up bitmap images
- Previous by thread: Re: Riddle Me This
- Next by thread: Re: Riddle Me This
- Index(es):
Relevant Pages
|