This document is archived and information here might be outdated.  Recommended version.


IMapControl2.ReadMxMaps Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IM > IMapControl2 Interface > IMapControl2.ReadMxMaps Method
ArcGIS Developer Help

IMapControl2.ReadMxMaps Method

Opens a map document specified by the supplied filename and reads the maps into an array object.

[Visual Basic .NET]
Public Function ReadMxMaps ( _
    ByVal fileName As String, _
    [ByVal password As Object] _
) As IArray
[C#]
public IArray ReadMxMaps (
    string fileName,
    object password
);
[C++]
HRESULT ReadMxMaps(
  BSTR fileName,
  VARIANT password
);
[C++]
Parameters
fileName [in]

fileName is a parameter of type BSTR password [in, optional]
password is a parameter of type VARIANT
To indicate this parameter is undefined pass in a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.

Product Availability

Available with ArcGIS Engine.

Description

ReadMxMaps creates an array of Map objects from the specified Map Document (ArcMap document, ArcMap template or ArcReader document).

Errors Returned

1018 800A03FA: The specified filename is invalid, the contents are corrupt or invalid

1019 800A03FB: The specified filename cannot be found 

1020 800A03FC: The specified filename is invalid, the file cannot be opened 

1021 800A03FD: The specified document has timed out

1031 800A0407: Password required to read this map document 

1032 800A0408: The specified password is incorrect

1033 800A0409: The password parameter does not contain a valid string 

Remarks

When ReadMXMaps is used the user may be prompted for a password; refer to the tables below to determine when this may occur. Additionally, password prompts may be given if accessing MapDocuments using either the MapControl's PropertyPage, ArcMap or ArcReader; the tables also show in what circumstances this will occur.

Reading Map Documents (*.mxd, *.mxt, *.pmf) which reference IMS Services (with and without security)

Application No Secure Services MXD/ MXT/ PMF files Secure Servcies MXD/ MXT/ PMF files Secure Servcies (password cached) MXD/ MXT files Secure Servcies (password cached) PMF files
MapControl (programmatically) No Prompt Prompt No Prompt Prompt
MapControl (property pages) No Prompt Prompt No Prompt Prompt
ArcMap No Prompt Prompt No Prompt Prompt
ArcReader (PMF files only) No Prompt Prompt N/A No Prompt

* The Connection to the Internet server must have the Save User/ Password setting enabled. This can be set, for example, when using Add Internet Server in the Add Layers Dialog. Additionally, in the case of PMF files the ArcPublisher Cache password in PMF file setting must be enabled.

Reading Published Map Files (*.pmf) (with and without password protection)

Application PMF with No Password PMF with Password
MapControl (programmatically) No Prompt Supply in Code
MapControl (property pages) No Prompt Prompt
ArcMap No Prompt Prompt
ArcReader No Prompt Prompt

See Also

IMapControl2 Interface | IMapControl3.CheckMxFile Method | IMapControl2.CheckMxFile Method | IMapControl4.CheckMxFile Method | IMapControl3.LoadMxFile Method | IMapControl2.LoadMxFile Method | IMapControl4.LoadMxFile Method