Thread View: borland.public.cppbuilder.multimedia
3 messages
3 total messages
Started by Jonathan Benedicto
Fri, 07 Jan 2005 05:11
IStream
Author: Jonathan Benedicto
Date: Fri, 07 Jan 2005 05:11
Date: Fri, 07 Jan 2005 05:11
25 lines
1469 bytes
1469 bytes
How do I use TStreamAdapter with TStream to get a IStream ?
I've tried this :
pFileStream = new TFileStream(m_pwszURL, fmOpenRead |
fmShareDenyWrite);
pStreamAdapter = new TStreamAdapter(pFileStream,
soReference);
...
hr =
pReaderAdvanced2->OpenStream((IStream*)(pStreamAdapter), this, NULL);
if(FAILED(hr)){
ShowMessage("Couldn't open file.");
break;
}
But it gives me a access violation.
Thank you.
--
Jonathan
Re: IStream
Author: Remy Lebeau (TeamB)
Date: Fri, 07 Jan 2005 07:54
Date: Fri, 07 Jan 2005 07:54
16 lines
1440 bytes
1440 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41de1a07$1@newsgroups.borland.com...
> hr =
pReaderAdvanced2->OpenStream((IStream*)(pStreamAdapter), this, NULL);
That should be this instead:
hr = pReaderAdvanced2->OpenStream(*pStreamAdapter, this, NULL);
TStreamAdapter has an IStream* conversion operator, but you have to
dereference the pointer to get to it.
Gambit
Re: IStream
Author: Jonathan Benedicto
Date: Fri, 07 Jan 2005 15:27
Date: Fri, 07 Jan 2005 15:27
25 lines
1656 bytes
1656 bytes
Thank you very much. It fixed the problem completely. -- Jonathan "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:41de40f5$1@newsgroups.borland.com... > > "Jonathan Benedicto" <incorrect@no.server> wrote in message > news:41de1a07$1@newsgroups.borland.com... > >> hr = > pReaderAdvanced2->OpenStream((IStream*)(pStreamAdapter), this, NULL); > > That should be this instead: > > hr = pReaderAdvanced2->OpenStream(*pStreamAdapter, this, NULL); > > TStreamAdapter has an IStream* conversion operator, but you have to > dereference the pointer to get to it. > > > Gambit > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads