You want to build a cluster with
nine Booleans,
one Int32,
_MAX_PATH uInt8s,
six Booleans,
four int32s,
six * _MAX_PATH uInt8s,
and eleven int32s.
If you happen to know or find out that BOOL is really four bytes, then
use int32s instead of Booleans. The arrays of chars turn into a
sequence or subcluster of uInt8s. In general, you should be able to
place subClusters around elements to organize them. Finally, your
header file had a pragma statement that is a bit unknown to me. It
might mean that the parameters are four byte padded. Making a small
test program that computes sizeof(FlashParameters) and perhaps the
offset of a few fields. Offset means you need to take the address of
the field and subtract the address of the struct. This can be used to
verify the size of various fields as well as additional padding that may
be inserted by the compiler. I'm referring to this as padding, but it is
really there to align multi-byte elements to a multi-byte boundary. An
example is that some/most compilers will put four byte elements on four
byte boundaries. This means that you might need to insert additional
bytes or int16s to get match what the compiler does. I'd recommend
naming all of these with names such as pad0, pad1, etc.
Greg McKaskle
> typedef struct _FlashParameters {
>
> //DialogBoxes Parameters
> BOOL m_bUart;
> BOOL m_bAddCommand;
> BOOL m_bGetDebug;
> BOOL m_bSkipPrimary;
> BOOL m_bExeFailure;
> BOOL m_bBootReplace;
>
> BOOL m_bCRC;
> BOOL m_bStartSL;
> BOOL m_bQuitSL;
> int m_iBootCodeAddress;
>
>
> char m_cBootPath[_MAX_PATH];
>
> BOOL m_bAutoSize;
> BOOL m_bAllCom;
> BOOL m_bLastConfig;
> BOOL m_bEraseSectors;
>
> BOOL m_bAdjustAU3Interval;
> BOOL m_bComOption;
> int m_iAU3Interval;
> int m_iComOptions;
>
>
> //Form Parameters
> int m_iBaudRateLoader;
> int m_iBaudRate;
> // int m_iPort;
> char m_cPort[_MAX_PATH];
>
> char m_cOtherPath[_MAX_PATH];
> char m_cLoaderPath[_MAX_PATH];
> char m_cHeaderPath[_MAX_PATH];
> char m_cFsPath[_MAX_PATH];
> char m_cFirmwarePath[_MAX_PATH];
>
> int m_iSoftware;
> int m_iChip;
>
> int m_iOtherCheck;
> int m_iLoaderCheck;
> int m_iHeaderCheck;
> int m_iFsCheck;
> int m_iFirmwareCheck;
>
> int m_iFirmwareAddress;
> int m_iHeaderAddress;
> int m_iFsAddress;
> int m_iOtherAddress;
>
>
> } FlashParameters;