Article View: borland.public.cppbuilder.multimedia
Article #1177FYI: Struct packing in mmreg.h
From: 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.
Technical Details
Message-ID:
<3b8a9884.15186507@forums.inprise.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,455c920401c8dfea,start X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2001-08-27 12:07:08 PST From: Frank K. Newsgroups: borland.public.cppbuilder.multimedia Subject: FYI: Struct packing in mmreg.h Date: Mon, 27 Aug 2001 18:59:54 GMT Message-ID: <3b8a9884.15186507@forums.inprise.com> X-Newsreader: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.116.70.142 X-Trace: dnews 998938711 24.116.70.142 (27 Aug 2001 11:58:31 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews