Article View: borland.public.cppbuilder.nativeapi
Article #12581Re: Subclassing an edit control
From: Martin Golm
Date: Fri, 28 Nov 2003 11:05
Date: Fri, 28 Nov 2003 11:05
22 lines
2053 bytes
2053 bytes
Gary Setter wrote: > I see that your main window which is the frame for your edit window reserves > memory for a pointer to a tWindow in > wndclass.cbWndExtra = sizeof(tWindow*); Yes, I do that to forward the messages from the global window procedure to the appropriate window's window procedure. Interestingly enough this isn't working for the edit control. First I didn't use SetWindowLong() with the GWL_WNDPROC parameter. It simply didn't exist. Whenever my application received a message for the edit control it crashed, and the call stack was non-exisiting (just a lot of ???'s). This was because the pointer I cast to tWindow* didn't represent a tWindow descendant. Don't know why... > But if you can't why not use Get/SetWindowLong(hWnd,GWL_USERDATA) ? > That would let you use the same technique to tie that tEdit/tWindow object > to the window handle in the static WndProc function. Sorry, I don't quite get the point? Martin
Technical Details
Message-ID:
<3FC72C07.F8402E63@gmx.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3FC37DC6.8A69A621@gmx.de> <3fc39946@newsgroups.borland.com> <3FC4C880.15E477D2@gmx.de> <3fc61f76@newsgroups.borland.com> <3fc62d43@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,7f8523ddb948f0d0 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-28 03:09:15 PST Message-ID: <3FC72C07.F8402E63@gmx.de> Date: Fri, 28 Nov 2003 12:05:43 +0100 From: Martin Golm <golm@gmx.de> X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Subclassing an edit control References: <3FC37DC6.8A69A621@gmx.de> <3fc39946@newsgroups.borland.com> <3FC4C880.15E477D2@gmx.de> <3fc61f76@newsgroups.borland.com> <3fc62d43@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.153.9.64 X-Trace: newsgroups.borland.com 1070017504 62.153.9.64 (28 Nov 2003 03:05:04 -0700) Lines: 23 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail