Article View: borland.public.cppbuilder.nativeapi
Article #14574Re: Windows wierdness (SendMessage, Win98, Win2000)
From: David
Date: Thu, 07 Aug 2003 19:27
Date: Thu, 07 Aug 2003 19:27
54 lines
3413 bytes
3413 bytes
Remy Lebeau (TeamB) wrote:
> What does your code look like that is calling add() in the first place? How
> are you allocating hwndC? Please show a more complete code snippet that
> demonstrates what you are asking doing.
The code that calls 'add:
TMyForm::TMyForm() :
WinBlankForm(NULL, 0, 0, 400, 400,
(WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW) &
~WS_SIZEBOX & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX),
cBoxC(this, 0, 0, clientWidth(), 250) {
ShowWindow(hwndC, SW_SHOW);
for (int i=0; i<16; ++i)
cBoxC.add(c_cast<char*>(mu::itoa(i).c_str()));
cBoxC.itemIndex(0);
}
The allocation of hwnd for the combo box (cBoxC):
WinComboBox::WinComboBox(WinControl * parent, int left, int top, int width, int height) :
WinControlWin(parent, left, top, width, height),
callBackFuncC(NULL) {
idC.changeCallback(WinComboBox::comboBoxCallback, this);
wCommandProcC = wCommandProc;
DWORD style = WS_CHILD | WS_TABSTOP | ES_LEFT | CBS_DROPDOWNLIST | WS_VSCROLL;
hwndC = CreateWindow("COMBOBOX", " ", style, leftC, topC, widthC, heightC,
parentC->hwnd(), (HMENU)idC.id(), gApp->hinst(), NULL);
if (!hwndC) throw AppException("Unable to create window");
SendMessage(hwndC, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),
MAKELPARAM(false, 0));
setupWindowProc();
ShowWindow(hwndC, SW_SHOW);
}
The allocation of hwnd for the TImportDeviceForm:
WinBlankForm::WinBlankForm(WinControl * parent, int x, int y, int top, int left,
long style, bool showIcon) :
WinBaseO(parent, x, y, top, left) {
hwndC = CreateWindowEx(WS_EX_CONTROLPARENT, winClassNameC, winCaptionC,
style, leftC, topC, widthC, heightC,
showIcon ? (parent ? parent->hwnd() : NULL) : NULL,
NULL, gApp->hinst(), NULL);
if (!hwndC) throw AppException("Unable to create window");
}
And it gets deeper quickly. I have stepped through it looking for buffer overruns. Cannot
see any. That doesn't mean they don't exist. I was hoping someone may have seen something
of this nature before where it seems to be platform specific.
David
Technical Details
Message-ID:
<3F32A82F.5080804@anonymous_one.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3F3288BA.4040402@earthlink.net> <3f328ea6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e6fc1d3446390cb0 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-07 12:35:59 PST Message-ID: <3F32A82F.5080804@anonymous_one.com> Date: Thu, 07 Aug 2003 14:27:43 -0500 From: David <david@anonymous_one.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Windows wierdness (SendMessage, Win98, Win2000) References: <3F3288BA.4040402@earthlink.net> <3f328ea6@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 64.157.113.81 X-Trace: newsgroups.borland.com 1060284331 64.157.113.81 (7 Aug 2003 12:25:31 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail