C++
virtual ACDBCORE2D_PORT Acad::ErrorStatus mapFile( ACHAR *& newName, const ACHAR * filename, int context, void* pReserved );
Description
Host applications, such as AutoCAD, sometimes require other auxiliary files as resources. For example, these files can be DWG files, DXF files, or image definition files. Before using the file resource, which can be obtained by the host application through different mechanisms, (for example arguments passed in from the API, stored in a drawing, stored in custom objects), these callbacks give an application an opportunity to map the file to some other file. Then the host uses the mapped file.
The mapFile() function can be called by AutoCAD or ObjectARX applications to map a file to another file.
In AutoCAD, this function returns eNotHandled if setMapFlag() has been used to turn off file mapping, or if no clients have used the registerMapFileCallback() function.
Parameters
| Parameters | Description |
|---|---|
| newName | New file name. Must be a full path. |
| filename | Full path of the file name Note: for each context, the file name can contain more information. For example, in case of resolving xref dwgs, the filename will contain: filename = pathName|parentPathName|blockName |
| context | In what context the file remapping is done. The low word will be used to indicated what kind of operation (kDrawingOpen, kXrefResolution, kRasterResolution, etc) and the high word will be a custom flag which is unique to the given context. |
| pReserved | Reserved for future use |
Notes
If this function returns Acad::eOk, then the caller of this function is responsible for deallocating the memory used by the newName argument. The preferred deallocation method is acutDelString().