Description

Creates the Subclass (Helper class) COM object and initializes data. Calls the Subclass's Open for further initialization

Return Type

None  

Syntax

object.Open [Source], [mode]

The Open Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McStream.
SourceOptional. A Variant value.
modeOptional. A mcfmFileMode enumeration, as described in settings.

Settings

The settings for mode are:

ConstantValueDescription
 mcSTREAM_READ1

open the file to read it into the image

 mcSTREAM_WRITE2

open the file to write it to a new or existing image file

 mcSTREAM_READ_WRITE3

open the file for both access (may not work for all formats)

Remarks

The Source parameter can be a filename or an IStream/IStorage object. If the Source parameter is VT_NULL or VT_EMPTY or VT_MISSING (ie not there) then the local property, FileName, is checked. If this is NULL, then an error is returned.

This method will set the FileFormatName, FileName, and Source properties, It creates the Subclass and calls Open on it for further initialization. At return time, the Image data is not actually open, but everything is in place for a call to Read or Write.

The second parameter, Mode, is one of mcfmFileMode members, indicating read, write, or both file permissions. Caution in using the mcSTREAM_READ_WRITE (both) parameter, since some subclasses may not support reading a file with write capabilities.

If a file is opened for Writing, but the type of Image file it contains cannot be determined by the file name, a “Magic” number scheme will be tried to determine the Image type. If this also fails, an error is returned.