🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13964

Re: Windows wierdness (SendMessage, Win98, Win2000) repeat

#13964
From: David
Date: Sun, 31 Aug 2003 19:39
37 lines
3114 bytes
Keith wrote:
> Recall that you can #pragma the compiler options at will, or break portions of code into other module that
> have a single particular compiler control set.
> 
> What I do find interesting about this is that the code generated from your app didn't change, but the
> USER32.SendMessageA action did change.  This indicates to me that a different version of the
> USER32.SendMessageA function was provided during the link phase, or that somewhere in the include files is
> a definition for SendMessageA that can have varying compiled output depending on compiler options.
> 
> keith

Not only that, but the ctor for the combobox also called SendMessage:

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));  //HERE!!!!
    setupWindowProc();
    ShowWindow(hwndC, SW_SHOW);
}

in the same unit and it didn't blow up there!  This makes me think that as the only thing in 
the add() routine is the SendMessage the compiler is somehow playing games, and if I was to 
place some dummy code after the SendMessage in the add() routine the problem might also be 
solved, but I haven't checked this assumption.

David

ps - I'm using BCB4.  What is your compiler?
Technical Details
Message-ID: <3F524EF5.8000603@anonymous_one.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3F50A23C.1090706@anonymous_one.com> <3F50C002.901B2CC9@sbcglobal.net> <3F5164FE.8000803@anonymous_one.com> <3F519DFF.B2345F35@sbcglobal.net> <3F51A27B.1A59EF47@sbcglobal.net> <3F51B1EE.50203@anonymous_one.com> <3F51F97D.8F17CCFA@sbcglobal.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d5c2d7b43b5c1d37
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-31 12:40:51 PST
Message-ID: <3F524EF5.8000603@anonymous_one.com>
Date: Sun, 31 Aug 2003 14:39:33 -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) repeat
References: <3F50A23C.1090706@anonymous_one.com> <3F50C002.901B2CC9@sbcglobal.net> <3F5164FE.8000803@anonymous_one.com> <3F519DFF.B2345F35@sbcglobal.net> <3F51A27B.1A59EF47@sbcglobal.net> <3F51B1EE.50203@anonymous_one.com> <3F51F97D.8F17CCFA@sbcglobal.net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.30.0.177
X-Trace: newsgroups.borland.com 1062358639 67.30.0.177 (31 Aug 2003 12:37:19 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail