Article View: borland.public.cppbuilder.nativeapi
Article #8839Re: SetClassLong problems
From: Remy Lebeau (TeamB)
Date: Mon, 06 Sep 2004 20:26
Date: Mon, 06 Sep 2004 20:26
26 lines
2127 bytes
2127 bytes
"Lynn Morrison" <Cranky@__whisp.com> wrote in message news:413bbf9c$1@newsgroups.borland.com... > MCustomSocketWindowClass.cbSize = sizeof(TWndClassEx); > MCustomSocketWindowClass.style = 0; > MCustomSocketWindowClass.cbClsExtra = sizeof(long); > MCustomSocketWindowClass.cbWndExtra = 0; > MCustomSocketWindowClass.hInstance = HInstance; > MCustomSocketWindowClass.hIcon = 0; > MCustomSocketWindowClass.hCursor = 0; > MCustomSocketWindowClass.hbrBackground; > MCustomSocketWindowClass.lpszMenuName = NULL; > MCustomSocketWindowClass.lpszClassName = "MCustomSocketWindowClass"; You did not assign the lpfnWndProc, hbrBackground, or hIconSm members. Once I gave those members real values, the code worked fine for me. Note also that you can specify the LocalWindProc() pointer to your TWndClassEx. Then you don't need to use SetWindowLong() to set the window procedure later. You should call MakeObjectInstance() in your class's constructor and FreeObjectInstance() in the destructor. You don't need to call call MAkeObjectInstance() everytime you create a new window. Gambit
Technical Details
Message-ID:
<413cc77b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4138cc6a@newsgroups.borland.com> <4138da54$1@newsgroups.borland.com> <4138ff19@newsgroups.borland.com> <413904eb$1@newsgroups.borland.com> <413bbf9c$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ce81aceba334526c X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4138cc6a@newsgroups.borland.com> <4138da54$1@newsgroups.borland.com> <4138ff19@newsgroups.borland.com> <413904eb$1@newsgroups.borland.com> <413bbf9c$1@newsgroups.borland.com> Subject: Re: SetClassLong problems Date: Mon, 6 Sep 2004 13:26:06 -0700 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <413cc77b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094502267 68.69.17.41 (6 Sep 2004 13:24:27 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail