G
Guest
Has anyone tried wrapping all of these interfaces up? I've been playing
around with doing this for IImagingFactory and have been gradually working
through the tree of calls. Some of them work they way I'd expect. Others
are creating some unusual problems. For example, I've created the following:
namespace IImageTesting
{
[ComImportAttribute()]
[GuidAttribute("0000000c-0000-0000-C000-000000000046")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IStream
{
int Read(IntPtr buffer, int numBytes, out int numRead);
int Write(IntPtr buffer, int numBytes, out int numWritter);
int Seek(long position, int origin, out long newPosition);
int SetSize(long newSize);
int CopyTo(IStream pstm, long numBytes, out long numRead, out long
numWritten);
int Commit(int commitFlags);
int Revert();
int LockRegion(long offset, long numBytes, int lockType);
int UnlockRegion(long offset, long numBytes, int lockType);
int Stat(ref StatStg statBuf, int statFlag);
int Clone(out IStream stm);
}
}
And then use it here:
[ClassInterface(ClassInterfaceType.None)]
public class StreamInIStream : IStream
{
private Stream _stm;
public StreamInIStream(Stream stm)
{
_stm = stm;
}
#region IStream Members
// boring details removed for brevity
#endregion
}
in this context:
FileStream stm = new FileStream("\\Program
Files\\IImageTesting\\4bit.bmp",
FileMode.Open);
StreamInIStream istm = new StreamInIStream(stm);
factory.CreateImageFromStream(istm, out blah);
At this point, CreateImageFromStream crashes the session with the
wonderfully descriptive error number 800704ca, which gives me this if I
search for it through the SDK header files:
Find all "800704ca", Match case, Subfolders, Find Results 1, "WinCE 5.0
includes", "*.h"
Matching lines: 0 Matching files: 0 Total files searched: 551
Ideas?
I'd like to be able to author my own codecs and image sinks in .NET, but
this isn't giving me warm fuzzies about that process.
around with doing this for IImagingFactory and have been gradually working
through the tree of calls. Some of them work they way I'd expect. Others
are creating some unusual problems. For example, I've created the following:
namespace IImageTesting
{
[ComImportAttribute()]
[GuidAttribute("0000000c-0000-0000-C000-000000000046")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IStream
{
int Read(IntPtr buffer, int numBytes, out int numRead);
int Write(IntPtr buffer, int numBytes, out int numWritter);
int Seek(long position, int origin, out long newPosition);
int SetSize(long newSize);
int CopyTo(IStream pstm, long numBytes, out long numRead, out long
numWritten);
int Commit(int commitFlags);
int Revert();
int LockRegion(long offset, long numBytes, int lockType);
int UnlockRegion(long offset, long numBytes, int lockType);
int Stat(ref StatStg statBuf, int statFlag);
int Clone(out IStream stm);
}
}
And then use it here:
[ClassInterface(ClassInterfaceType.None)]
public class StreamInIStream : IStream
{
private Stream _stm;
public StreamInIStream(Stream stm)
{
_stm = stm;
}
#region IStream Members
// boring details removed for brevity
#endregion
}
in this context:
FileStream stm = new FileStream("\\Program
Files\\IImageTesting\\4bit.bmp",
FileMode.Open);
StreamInIStream istm = new StreamInIStream(stm);
factory.CreateImageFromStream(istm, out blah);
At this point, CreateImageFromStream crashes the session with the
wonderfully descriptive error number 800704ca, which gives me this if I
search for it through the SDK header files:
Find all "800704ca", Match case, Subfolders, Find Results 1, "WinCE 5.0
includes", "*.h"
Matching lines: 0 Matching files: 0 Total files searched: 551
Ideas?
I'd like to be able to author my own codecs and image sinks in .NET, but
this isn't giving me warm fuzzies about that process.