L
Lars Stenberg
Hello!
Im sitting here and trying to retreive som avi information, but the
invoke of the AVIFileInfo throws a nullpointer exception.
snipp
-------
public struct AVIFILEINFO {
public long dwMaxBytesPerSec;
public long dwFlags;
public long dwCaps;
public long dwStreams;
public long dwSuggestedBufferSize;
public long dwWidth;
public long dwHeight;
public long dwScale;
public long dwRate;
public long dwLength;
public long dwEditCount;
public string szFileType;
}
class Class1 {
....
[DllImport("avifil32.dll")]
private static extern void AVIFileInit();
[DllImport("avifil32.dll")]
private static extern void AVIFileExit();
[DllImport("avifil32.dll")]
private static extern long AVIFileOpen(ref long ppfile, string
szFile, long mode, object pclsidHandler);
[DllImport("avifil32.dll")]
private static extern long AVIFileRelease(long pfile);
[DllImport("avifil32.dll")]
private static extern long AVIFileInfo (long pfile, ref AVIFILEINFO
pfi, long lSize);
....
public Class1() {
AVIFileInit();
long hFile = 0;
AVIFILEINFO aviInfo = new AVIFILEINFO();
AVIFileOpen(ref hFile, @"C:\klowner.avi", 0, null);
AVIFileInfo(hFile, ref aviInfo,
System.Runtime.InteropServices.Marshal.SizeOf(aviInfo));
AVIFileRelease(hFile);
AVIFileExit();
}
}
AVIFileOpen returns long, 68116944363978752
When the exception is thrown hFile == 3761212
Anyone have any clue?
Regards,
Lars
Im sitting here and trying to retreive som avi information, but the
invoke of the AVIFileInfo throws a nullpointer exception.
snipp
-------
public struct AVIFILEINFO {
public long dwMaxBytesPerSec;
public long dwFlags;
public long dwCaps;
public long dwStreams;
public long dwSuggestedBufferSize;
public long dwWidth;
public long dwHeight;
public long dwScale;
public long dwRate;
public long dwLength;
public long dwEditCount;
public string szFileType;
}
class Class1 {
....
[DllImport("avifil32.dll")]
private static extern void AVIFileInit();
[DllImport("avifil32.dll")]
private static extern void AVIFileExit();
[DllImport("avifil32.dll")]
private static extern long AVIFileOpen(ref long ppfile, string
szFile, long mode, object pclsidHandler);
[DllImport("avifil32.dll")]
private static extern long AVIFileRelease(long pfile);
[DllImport("avifil32.dll")]
private static extern long AVIFileInfo (long pfile, ref AVIFILEINFO
pfi, long lSize);
....
public Class1() {
AVIFileInit();
long hFile = 0;
AVIFILEINFO aviInfo = new AVIFILEINFO();
AVIFileOpen(ref hFile, @"C:\klowner.avi", 0, null);
AVIFileInfo(hFile, ref aviInfo,
System.Runtime.InteropServices.Marshal.SizeOf(aviInfo));
AVIFileRelease(hFile);
AVIFileExit();
}
}
AVIFileOpen returns long, 68116944363978752
When the exception is thrown hFile == 3761212
Anyone have any clue?
Regards,
Lars