Herd Software Development
DaVinci Graphics Library
DaVinci Documentation
IPERROR FAR PASCAL IpImportExt(
HDIB FAR * phDib,
HMETAFILE FAR * phMeta,
LPSTR pszName,
DWORD dwFlags,
IPCALLBACKPROC fnBck,
DWORD FileTyp,
HWND hWnd,
LPPOINT pnSize,
LPMETARESOLUTION lpmr,
DWORD dummy);
phDib Pointer to a variable of type HDIB. When function returns, this variable will contain a value not equal to NULL if a DIB (Device Independent Bitmap) was generated during the import.
phMeta Pointer to a variable of type HMETAFILE. When function returns, this variable will contain a value not equal to NULL if a Windows metafile was generated during the import.
pszName Filename (may be NULL). If not NULL and the IPF_FILEDIALOG flag is set, the name of the imported file is stored here. If pszName is specified prior to execution, that filename is used as the file open dialog's default. Therefore, pszName must always point at a valid file name string with <100 characters. If pszName is NULL, or points to an empty string, DaVinci builds a string with the list of valid extensions including *.BMP;*.TIF;*.GIF ..., etc.
If pszName points to a valid filename and the IPF_FILEDIALOG flag is not set in dwFlags, DaVinci imports the file specified in the parameter without displaying a file open dialog. If IPT_SELECT was specified as FileType, DaVinci automatically determines the input filetype using its extension. If the extension does not correspond to the default extensions used for supported formats, then DaVinci will attempt to determine its type by analyzing the file's contents.
dwFlags A combination of flags of the IPF_xxxx series, combined with the bitwise OR operator ("|").
fnBck Address of a callback procedure used during conversion. This procedure can be used to respond to errors, update progress indicators, or allow abort of the import. The callback is being called from time to time during the import process allowing the application to react on user input, display progress information and so on. Since DaVinci is not re-entrant, an error will be produced if DaVinci is asked to start an additional import function while the previous import is still in progress.
Assign FALSE as the callback's return value to abort the import operation.
If NULL is specified for fnBck, DaVinci watches only for the escape key and aborts if it is pressed. Windows multitasking is not supported.
In 16 bit Windows applications, fnBck must be exported using MakeProcInstance.
hWnd Handle of window used as parent for file dialog and error messages. Use the handle of the main or topmost dialog of the calling application wherever possible; assigning 0 as parent is not recommended.
FileTyp IPT_xxxx file type specification. Normally used if IPF_FILEDIALOG was not specified as a value for dwFlags. IPT_SELECT limits the application to this file type.
pnSize Pointer to a POINT structure with the resolution specification of a memory bitmap. Used when converting a metafile to a DIB, can be NULL if conversion is not needed. (If NULL, file formats which use this information will not be supported.)
lpmr Pointer to a METARESOLUTION structure with specifications of resolution (size in millimeters and aspect ratio) of the metafile. (+++ Accurate? If not, then be specific here bwcause you says these fields are required. NULL if a bitmapped image is imported as a DIB.)
lParam Application defined 32-Bit value which is transferred to the callback function in fnBck. (+++again, is this required even if no callback is used??)
Returns 0 on success; otherwise returns an error corresponding to one of the IPE_xxxx error codes.
This function is provided for backward compatibility with DaVinci 2.x. New and re-engineered applications should use the ipImportInd function.