<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello and thanks for your replies.<br>
<br>
Sorry, I pasted the wrong code snippet on mistake. I did it the
following way but always get an
unhandled exception in apphelp.dll because of a memory access violation
at
position 0x00000010 (that's what the debugger tells me if I translated
it correctly). The exception occurs within the operation calling stack
initiated by ov_open. <br>
<blockquote><small><font face="Helvetica, Arial, sans-serif"><small>#ifndef
_UNICODE</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>#define
_UNICODE // App uses Unicode.</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>#endif</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small></small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>#ifndef
VC_EXTRALEAN</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>#define
VC_EXTRALEAN // Exclude rarely-used stuff from Win32
headers</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>#endif</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif">...</font></small><br>
<small><font face="Helvetica, Arial, sans-serif"></font><font
face="Helvetica, Arial, sans-serif"><small>//Let's open
the file in binary mode for reading.</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> FILE *f =
_tfopen(pFilePath, _T("rb"));</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> if (f ==
NULL)</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> {</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
data.valid = false;</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
return;</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> }</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small></small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> // Let's
initialize the OggVorbis_File.</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
if(ov_open(f, &vf, NULL, 0) < 0)</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> {</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
fclose(f);</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
data.valid = false;</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>
return;</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small> }</small></font></small><br>
</blockquote>
While debugging I recognized that the pointer to the FILE struct is
valid, but the struct content is not somehow. This is what the debugger
tells me:<br>
<blockquote><small><font face="Helvetica, Arial, sans-serif"><small>-
f@0x1027c898 {_ptr=0x00000000 <Bad Ptr> _cnt=0 _base=0x00000000
<Bad Ptr> ...}</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_ptr=0x00000000
<Bad Ptr> char *</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_cnt=0
int</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_base=0x00000000
<Bad Ptr> char *</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_flag=1
int</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_file=3
int</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_charbuf=0
int</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_bufsiz=0
int</small></font></small><br>
<small><font face="Helvetica, Arial, sans-serif"><small>f->_tmpfname=0x00000000
<Bad Ptr> char *</small></font></small><br>
</blockquote>
Does anyone know what I do wrong?<br>
<br>
Thanks.<br>
<br>
<br>
Wan-Hi<br>
<br>
<br>
<br>
Paul Martin wrote:
<blockquote cite="mid20050524081025.GA9595@thinkpad.nowster.org.uk"
type="cite">
<pre wrap="">On Tue, May 24, 2005 at 01:16:51AM +0200, Wan-Hi wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> if (_topen(pFilePath, _O_RDONLY | _O_BINARY) == -1)
</pre>
</blockquote>
<pre wrap=""><!---->
You open a file, then throw away the handle.
</pre>
<blockquote type="cite">
<pre wrap=""> if(ov_open(stdin, &vf, NULL, 0) < 0)
</pre>
</blockquote>
<pre wrap=""><!---->
You try to open a Vorbis file from STDIN, which is probably not the file
you opened with _topen().
</pre>
</blockquote>
</body>
</html>