ImportFile Method

WRAPPER_API bool ImportFile(const BmgChar *fileName)

 

Description

The ImportFile method loads a CoordSys from a file and adds it to the data source.  The file can be either a TAB, MAP, PRJ, or WKT file.  If the Editable property is false when this method is called, a GeoCalcException will be thrown with an ErrorCode specifying FileReadOnly.  If the specified file cannot be found, a GeoCalcException will be thrown with an ErrorCode specifying FileNotFound.

 

Example

void DataSource_ImportFile(GEOCALCPBW_NAMESPACE::DataSource & data)

{

if(data.get_IsLoaded() && data.get_Editable())

{

_towchar filename("c:\\MyCoordSys.prj");

if(! data.ImportFile(filename.c_str()))

{

AfxMessageBox("ImportFile failed");

}

}

}