Moray Plugin SDK Documentation
This release of the Plugin SDK can be used by Moray V3.5 (Build 9065) and later.

CSceneInterface CFilesInterface CMenuInterface CImportInterface
CExportInterface CObjectInterface CExternalInterface
CPluginDialog CPluginObject
CAttributes CProgressBar C support Compiler Settings

What's New

CFilesInterface

This class encapsulates the Files Interface in a C++ wrapper. It handles a file with a certain extension (or multiple extensions). It can also be used to prompt for a filename of another type, for example one of the predefined types. See the PromptForFilename for details.

Reference List of Functions

By Function Group Alphabetically
m_pFunctions
CFilesInterface
GetExtensions
GetDefaultExtension
PromptForFilename
QualifyFilename
GetFunctions
CFilesInterface
GetDefaultExtension
GetExtensions
GetFunctions
PromptForFilename
QualifyFilename
m_pFunctions



 

m_pFunctions


   LPMRY_FILESFUNCS m_pFunctions; [protected]

The member variable m_pFunctions is a pointer to the MRY_FILESFUNCS structure that this class encapsulates.


Top
 

CFilesInterface

The function CFilesInterface is the constructor of this interface.

    CFilesInterface(LPMRY_INTERFACEID pUID);

Parameters

pUID

Contains a pointer to the MRY_INTERFACEID that uniquely identifies this interface.

Remarks

The interface ID that pUID points to should be generated with the MKUID.EXE program that comes with the Plugin SDK.

Note that classes derived from this class may not define their constructor, since this is done in a macro. However, the constructor calls the Init function once the object has been setup.

See Also

Init


Top
 

GetExtensions

The function GetExtensions returns the extension string that this interface should handle.

    virtual CString GetExtensions()=0;

Remarks

See the achFilter member of the MRY_FILESFUNCS struct for the formatting of the string.


Top
 

GetDefaultExtension

The function GetDefaultExtension returns the default extension string that this interfaces should handle.

    virtual CString GetDefaultExtension()=0;

Remarks

See the achDefaultExt member of the MRY_FILESFUNCS struct for the formatting of the string.


Top
 

PromptForFilename

The function PromptForFilename prompts the user for a filename of a certain type.

    long PromptForFilename(char * pszName, int nAttribs, int nType);

Parameters

pszName

Contains the location where the name of the file should be written to.

nAttribs

Contains flags that determine the behaviour of the File Selector that pops up. See Remarks.

nType

Contains an optional parameter that determines the type of file that should be prompted for. See Remarks.

Return Values

MRY_SUCCESS

if the function was successful.

MRY_ERR_NO_FILE_SELECTED

if no file was selected (Cancel was pressed).

Remarks

This function can be used to prompt the user for a file and have Moray handle the maintenance of the Search paths associated with the file type.

The nType parameter can be one of the following values:


The nAttribs parameter can be a combination of the following flags:


The pszName parameter will contain only the filename, not the path, unless the file type is MRY_FILES_MORAY_SCENE, MRY_FILES_MORAY_OBJECTS or MRY_FILES_TEXTURE_LIB. In those cases the parameter will contain the full path name. To obtain the full path name in the other cases, use the QualifyFilename function.

The pszName parameter must be initialized and should contain the default filename. If you do not want a default name, set it to a zero-length string.

See Also

QualifyFilename


Top
 

QualifyFilename

The function QualifyFilename turns a filename into a fully qualified file name, i.e. with drive and directory.

    long QualifyFilename(char * pszName, int nType);

Parameters

pszName

Contains the name of the file to be qualified.

nType

Contains an optional parameter that determines the type of file that should be prompted for. See Remarks.

Return Values

MRY_SUCCESS

if the function was successful.

MRY_ERR_FILE_NOT_FOUND

if the file could not be found.

Remarks

This function will search for the filename pszName in the directories of the Search Path for this type of file. It writes the fully qualified filename back to pszName.

See PromptForFilename for a list of file types.

See Also

PromptForFilename


Top
 

GetFunctions

The function GetFunctions returns the interface pointer to a MRY_INTERFACE struct.

    LPMRY_INTERFACE GetFunctions();
Top