MMIOM_QUERYIMAGECOUNT
Appearance
The MMIOM_QUERYIMAGECOUNT message is sent to an image-specific Multimedia I/O (MMIO) procedure to determine the total number of individual images or frames stored within the currently open image file.
Syntax
rc = mmioSendMessage(hmmio, MMIOM_QUERYIMAGECOUNT, (LONG)pulImageCount, lParam2);
Parameters
- pmmioinfo (PMMIOINFO)
- A pointer to an MMIOINFO data structure maintaining the current state of the open file.
- usMsg (USHORT)
- The message identifier, set to `MMIOM_QUERYIMAGECOUNT`.
- pulParam1 (PULONG)
- A pointer to a `ULONG` variable where the I/O procedure writes the total count of images contained within the file.
- lParam2 (LONG)
- This parameter is not used.
Return Value
- rc (ULONG)
- Return codes indicating success or functional fallback states:
- MMIO_SUCCESS: The request was successful, and the total image count has been written to pulParam1.
- MMIO_ERROR: An error occurred while parsing the container structures or counting the resource records.
- MMIOERR_UNSUPPORTED_FUNCTION: The message is not supported by the current image I/O procedure. This indicates that the file format does not support multiple frames, and the application should assume the file contains exactly one (`1`) image.
Remarks
- **Multi-Image Boundaries**: This message allows an application to discover the available range of frames before navigating through a composite graphic payload. It provides the upper bound for index verification loops.
- **Safe Fallback**: If an I/O procedure returns `MMIOERR_UNSUPPORTED_FUNCTION`, it signifies that the underlying codec processes strictly single-frame images (such as standard OS/2 bitmaps). Programs should intercept this return value and manually set their image count tracker to `1` rather than treating it as a critical failure.