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 » 1 byte packing alignment Collapse All
Subject Author Date
Rene Toellner Nov 22, 2006 - 6:44 AM

Hi,

I need to use 1 byte structure packing alignment (compiler option /Zp1) in my Prof-UIS project. This seems to work when I rebuild the Prof-UIS DLLs with the same compiler option. Can this lead to any unforeseen problems or is it OK to do so?

With kind regards

R.T.

ATS ATS Dec 15, 2008 - 12:30 PM

Thanks for the reply,


Are you saying, that there is a 1 byte build opf Prof-UIS? If so where?

ATS ATS Dec 15, 2008 - 11:26 AM

Almost forgot, command line options to build Skinnable are as such:


/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


 


 


 


 


 

ATS ATS Dec 15, 2008 - 11:25 AM

We have purchased the toolkil and also need to get 1 byte member alignment. There is no build that comes with it, that has 1 byte member alignment in it. When building the Skinable sample, for ANSI char set, static links to MFC and ATL, with /Zp1 (1 byte member alignment in C++ Code Generation), the application blows up in the DEBUG build in atlsimplstr.h, line 539, from the following call stack:


 


  Skinable-nd.exe!ATL::CSimpleStringT<char,0>::GetLength()  Line 539 + 0x8 bytes C++

  Skinable-nd.exe!ATL::CSimpleStringT<char,0>::SetString(const char * pszSrc=0x012355ec, int nLength=0x00000006)  Line 638 + 0x8 bytes C++

  Skinable-nd.exe!ATL::CSimpleStringT<char,0>::SetString(const char * pszSrc=0x012355ec)  Line 620 C++

  Skinable-nd.exe!ATL::CSimpleStringT<char,0>::operator=(const char * pszSrc=0x012355ec)  Line 340 C++

  Skinable-nd.exe!ATL::CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT<char> > >::operator=(const char * pszSrc=0x012355ec)  Line 1282 C++

> Skinable-nd.exe!CExtMenuControlBar::SetMdiWindowPopupName(const char * sMdiWindowPopupName=0x012355ec)  Line 5174 C++

  Skinable-nd.exe!CMainFrame::OnCreate(tagCREATESTRUCTA * lpCreateStruct=0x0012f5d0)  Line 1161 + 0x21 bytes C++

  Skinable-nd.exe!CWnd::OnWndMsg(unsigned int message=0x00000001, unsigned int wParam=0x00000000, long lParam=0x0012f5d0, long * pResult=0x0012f2d0)  Line 2000 + 0xd bytes C++

  Skinable-nd.exe!CWnd::WindowProc(unsigned int message=0x00000001, unsigned int wParam=0x00000000, long lParam=0x0012f5d0)  Line 1741 + 0x20 bytes C++

  Skinable-nd.exe!CExtNCW<CMDIFrameWnd>::WindowProc(unsigned int message=0x00000001, unsigned int wParam=0x00000000, long lParam=0x0012f5d0)  Line 426 + 0x14 bytes C++

  Skinable-nd.exe!AfxCallWndProc(CWnd * pWnd=0x023a0068, HWND__ * hWnd=0x00031742, unsigned int nMsg=0x00000001, unsigned int wParam=0x00000000, long lParam=0x0012f5d0)  Line 240 + 0x1c bytes C++

  Skinable-nd.exe!AfxWndProc(HWND__ * hWnd=0x00031742, unsigned int nMsg=0x00000001, unsigned int wParam=0x00000000, long lParam=0x0012f5d0)  Line 389 C++

  user32.dll!7e418724()  

  [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] 

  user32.dll!7e41d043()  

  user32.dll!7e41b4b0()  

  user32.dll!7e41884a()  

  user32.dll!7e41fd09()  

  ntdll.dll!7c90eae3()  

  Skinable-nd.exe!CExtTabOneNoteWnd::stat_OnTabWndDrawItemOneNoteImpl(CExtTabOneNoteWnd * pWndTabs=0x0012f610, CDC & dc={...}, CRect & rcTabItemsArea={...}, long nItemIndex=0x008b6737, CExtTabWnd::TAB_ITEM_INFO * pTii=0x7e41b463, bool bTopLeft=true, bool bHorz=true, bool bSelected=true, bool bCenteredText=true, bool bGroupedMode=false, bool bInGroupActive=true, bool bInvertedVerticalMode=true, const CRect & rcEntireItem={...}, CSize sizeTextMeasured={...}, CFont * pFont=0x3a313130, const char * sText=0x30303030, CExtCmdIcon * pIcon=0x30303030, unsigned long clrForceTabText=0x4630303a, unsigned long clrForceTabBk1=0x31353132, unsigned long clrForceTabBk2=0xa02d0042)  Line 6784 + 0x1c bytes C++


 

Technical Support Dec 18, 2008 - 11:14 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.

Technical Support Nov 22, 2006 - 11:08 AM

There should not be any problem with a custom structure alignment applied to the Prof-UIS code. Just make sure the same byte alignment is used in Prof-UIS as in your application.

ATS ATS Dec 15, 2008 - 12:35 PM

I think my last post got lost, so I’ll resubmit this one.


 


Thanks for the reply. Are you saying the Prof-UIS has a /Zp1 build? If so where, and how does one use it?