Hi,

I have a strange problem with toolbar appearance. I create the toolbar
in the OnInitDialog() method with the following code:

CToolBarCtrl m_wndToolBar;

m_wndToolBar.Create(WS_VISIBLE|WS_CHILD|CCS_TOP|TB STYLE_TOOLTIPS,
CRec(0,0,0,0),this, IDD_TOOLBARCTRL);
//m_wndToolBar.AutoSize();
m_wndToolBar.AddBitmap(4, IDD_TOOLBARCTRL);
TBBUTTON Buttons[4];
int commands[4] = {ID_LOAD_PARAMS_FILE, ID_FILE_OPEN,
ID_SAVE_PARAMS_FILE, ID_APP_ABOUT};
int nButtonCount = 4;
for (int nIndex = 0; nIndex < nButtonCount; nIndex++) {
Buttons[nIndex].fsState = TBSTATE_ENABLED;
Buttons[nIndex].fsStyle = TBSTYLE_BUTTON;
Buttons[nIndex].dwData = 0;
Buttons[nIndex].iBitmap = nIndex;
Buttons[nIndex].idCommand = commands[nIndex];
}

TBBUTTON sepButton;
sepButton.idCommand = 0;
sepButton.fsStyle = TBSTYLE_SEP;
sepButton.fsState = TBSTATE_ENABLED;
sepButton.iString = 0;
sepButton.iBitmap = 0;
sepButton.dwData = 0;

for (nIndex = 0; nIndex < nButtonCount; nIndex++) {
VERIFY(m_wndToolBar.AddButtons(1,&Buttons[nIndex]));
if (!((nIndex +1) % 3))
VERIFY(m_wndToolBar.AddButtons(1,&sepButton));
}

This usualy works fine and creates a toolbar with 4 buttons and
separator button while each button looks like a standard square image.
Sometimes on other computers the toolbar looks like the butons are
smashed and they are spread like tabs to fill the entire window area
horizontally.
Any ideas that can solve this problem would be highly appreciated.

Thanks,
Dima.