Thread View: borland.public.cppbuilder.multimedia
1 messages
1 total messages
Started by Frank K.
Mon, 27 Aug 2001 18:59
FYI: Struct packing in mmreg.h
Author: Frank K.
Date: Mon, 27 Aug 2001 18:59
Date: Mon, 27 Aug 2001 18:59
20 lines
1545 bytes
1545 bytes
I recently upgraded to BCB 5. One project, which uses the ACM, no longer functioned correctly after rebuilding in BCB 5. I traced the problem to mmreg.h failure to invoke #pragma pack(1) which packs structs on byte boundaries. Specifically, the WAVEFORMAT structures for compressed formats, MPEGLAYER3WAVEFORMAT for example, inserted two extra bytes at the boundary between the WAVEFORMATEX member and the tag specific fields. The line #if !defined( RC_INVOKED ) && defined( _MSC_VER ) at the top of mmreg.h causes the problem. Since _MSC_VER is not defined by BCB #pragma pack(1) is never invoked. Simply adding #ifndef _MSC_VER #define _MSC_VER 1020 #endif to the top of mmreg.h solves the problem.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads