Click here to Skip to main content
15,920,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Large Icon Display Pin
Johnny ²9-May-03 0:52
Johnny ²9-May-03 0:52 
GeneralRe: Large Icon Display Pin
Kyudos9-May-03 1:05
Kyudos9-May-03 1:05 
GeneralCFile::Open problem Pin
Trollslayer9-May-03 0:38
mentorTrollslayer9-May-03 0:38 
GeneralGDI+ Pin
sharlila9-May-03 0:33
sharlila9-May-03 0:33 
Generaldirectshow Pin
sharlila9-May-03 0:21
sharlila9-May-03 0:21 
GeneralRe: directshow Pin
Trollslayer9-May-03 1:18
mentorTrollslayer9-May-03 1:18 
Generalwhere?!?! Pin
sharlila9-May-03 7:50
sharlila9-May-03 7:50 
Generaltry, throw and catch statement Pin
Raphael Kindt8-May-03 23:53
Raphael Kindt8-May-03 23:53 
GeneralRe: try, throw and catch statement Pin
G. Steudtel9-May-03 1:16
G. Steudtel9-May-03 1:16 
GeneralRe: try, throw and catch statement Pin
Raphael Kindt9-May-03 1:35
Raphael Kindt9-May-03 1:35 
GeneralRe: try, throw and catch statement Pin
jhwurmbach9-May-03 2:14
jhwurmbach9-May-03 2:14 
QuestionHow to write protect a folder and files Pin
seewan8-May-03 23:52
seewan8-May-03 23:52 
Generalvariables in namespaces Pin
Themis8-May-03 23:26
Themis8-May-03 23:26 
GeneralRe: variables in namespaces Pin
Johnny ²9-May-03 1:01
Johnny ²9-May-03 1:01 
QuestionResource leak? Pin
Gavin Jerman8-May-03 23:21
Gavin Jerman8-May-03 23:21 
AnswerRe: Resource leak? Pin
Anonymous9-May-03 1:03
Anonymous9-May-03 1:03 
AnswerRe: Resource leak? Pin
Anders Molin9-May-03 1:16
professionalAnders Molin9-May-03 1:16 
GeneralFinding Logged In User Access Level Pin
jerry0davis8-May-03 23:14
jerry0davis8-May-03 23:14 
QuestionSimultaneous sounds? Pin
Gadjuka8-May-03 23:07
Gadjuka8-May-03 23:07 
AnswerRe: Simultaneous sounds? Pin
G. Steudtel9-May-03 0:54
G. Steudtel9-May-03 0:54 
AnswerRe: Simultaneous sounds? Pin
Anonymous9-May-03 0:55
Anonymous9-May-03 0:55 
GeneralInteraction with ActieveX Pin
andreshs18-May-03 22:43
andreshs18-May-03 22:43 
GeneralExtracting the IStream interface from CFile Pin
Anders Sandberg8-May-03 22:28
Anders Sandberg8-May-03 22:28 
GeneralRe: Extracting the IStream interface from CFile Pin
Anonymous8-May-03 23:17
Anonymous8-May-03 23:17 
GeneralRe: Extracting the IStream interface from CFile Pin
Mike Dimmick9-May-03 6:05
Mike Dimmick9-May-03 6:05 
I've had some luck with the CArchiveStream class declared in the <afxpriv2.h> header (at least in VC6.0, 7.0 and 7.1; also in eVC 3.0).

This class is what MFC uses for feeding ActiveX controls on dialog boxes. I don't expect it to change, but it might.

Using it is quite simple:
<br />
CFile file( /* ... */ );<br />
CArchive ar( &file, /* ... */ );<br />
CArchiveStream arStm( &ar );<br />
<br />
IStream* pStm = &arStm;<br />
<br />
/* Use pStm */<br />
Obviously if you need the stream object to have a longer lifetime, you'll need to create all the objects (arStm, ar, file) on the heap instead.

Minor edits - decided to make IStream more obvious

--
Mike Dimmick

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.