Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » /Zp1 - One byte member alignment. Collapse All
Subject Author Date
ATS ATS Dec 15, 2008 - 12:42 PM

Please help,


We have existing code that uses /Zp1 - One byte member alignment which we can not get to work with Prof-UIS. We isolated Prof-UIS code using the Skinable sample, and can not get it to run. It compiles and links, but blows up at run time, the moment /Zp1 (one bytes member alignment) is used. Here is the C/C++ and Link commands we want the Skinnable sample to work with:


/Od /I "..\..\include" /D "_DEBUG" /D "PROF_UIS_FORCE_NO_MANIFEST" /D "WIN32" /D "_WINDOWS" /D "_WIN32_WINNT=0x0400" /D "_WIN32_IE=0x0400" /D "_VC80_UPGRADE=0x0600" /D "_ATL_STATIC_REGISTRY" /Gm /EHsc /RTC1 /MTd /Zp1 /Yu"stdafx.h" /Fp".\..\..\Bin_800\AnsiDEBUG\Skinable/Skinable_800.pch" /Fo".\..\..\Bin_800\AnsiDEBUG\Skinable/" /Fd".\..\..\Bin_800\AnsiDEBUG\Skinable/" /W4 /nologo /c /ZI /TP /errorReport:prompt


Notice the /Zp1 above....


Link command:


/OUT:"..\..\Bin_800/Skinable-nd.exe" /INCREMENTAL /NOLOGO /LIBPATH:"..\..\Bin_800" /MANIFEST /MANIFESTFILE:".\..\..\Bin_800\AnsiDEBUG\Skinable\Skinable-nd.exe.intermediate.manifest" /DELAYLOAD:"OleAcc.dll" /DEBUG /PDB:".\..\..\Bin_800/Skinable-nd.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 /ERRORREPORT:PROMPT  DelayImp.lib


 


 

miles waldron Dec 29, 2008 - 12:28 PM

I do not understand this answer. I believe there is a more complete answer that needs to be investigated.


Why doesn’t Prof-UIS support 1 byte alignment? As per the PROF-UIF license agreement I have the code and I can rebuild all the subsequent projects. Why can’t I change everything over to 1 byte alignment and rebuild everything? Changing the alighment is an option with MFC is a compiler. It is there for a good reason.


Furthermore, It is very poor practice to write code that relys on the byte alignment of offests into structures. Are you saying that PROF-UIF has made assumptions about the byte alighments to offsets within structures? The PROF-UIF code seems very good, and I seriously doubt that this is really an issue.


Can you please let us know the proper methodology for rebuilding all of PROF-UIF with 1-byte alignment.


What I did was this. I went into the PROF-UIF workspace for version 8 ANSI, and set every project in every configuration to ZP1. Then I went into PROF-UIF integration wizard and rebuilt everything.


Is this the complete process? Am I leaving anything out? Can someone in technical support who knows about building the libraries please respond to this question?


Thanks!


Miles Waldron


 

Technical Support Dec 18, 2008 - 11:15 AM

Prof-UIS does not support the option of 1 byte alignment. Changing the structure alignment option can bring problems with MFC and any other libraries used in your projects. If you need 1 byte structure alignment in some parts of your project, then you should change it only where this optimization is needed. This can be done with #pragma directives.

miles waldron Dec 29, 2008 - 12:31 PM

 do not understand this answer. I believe there is a more complete answer that needs to be investigated.


Why doesn’t Prof-UIS support 1 byte alignment? As per the PROF-UIF license agreement I have the code and I can rebuild all the subsequent projects. Why can’t I change everything over to 1 byte alignment and rebuild everything? Changing the alighment is an option with MFC is a compiler. It is there for a good reason.


 


Furthermore, It is very poor practice to write code that relys on the byte alignment of offests into structures. Are you saying that PROF-UIF has made assumptions about the byte alighments to offsets within structures? The PROF-UIF code seems very good, and I seriously doubt that this is really an issue.


 


Can you please let us know the proper methodology for rebuilding all of PROF-UIF with 1-byte alignment.


 


What I did was this. I went into the PROF-UIF workspace for version 8 ANSI, and set every project in every configuration to ZP1. Then I went into PROF-UIF integration wizard and rebuilt everything.


 


Is this the complete process? Am I leaving anything out? Can someone in technical support who knows about building the libraries please respond to this question?


 


Thanks!


 


Miles Waldron