- int len = (int)SendMessage((HWND) GetHWND(), CB_GETLBTEXT, n, (long)wxBuffer);
- wxBuffer[len] = 0;
- return wxString(wxBuffer);
-}
-
-void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
-{
- int currentX, currentY;
- GetPosition(¤tX, ¤tY);
-
- int x1 = x;
- int y1 = y;
- int w1 = width;
- int h1 = height;
-
- if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
- x1 = currentX;
- if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
- y1 = currentY;
-
- AdjustForParentClientOrigin(x1, y1, sizeFlags);
-
- // If we're prepared to use the existing size, then...
- if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
- {
- GetSize(&w1, &h1);
- }
+ size_t len = (size_t)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
+ wxString str;
+ if ( ::SendMessage(GetHwnd(), CB_GETLBTEXT, n,
+ (LPARAM)str.GetWriteBuf(len)) == CB_ERR )
+ {
+ wxLogLastError("SendMessage(CB_GETLBTEXT)");
+ }