Subject: RE: Set/GetWindowLong doesn't seem work
From: [email-masked] (Karl M. Syring)

10 Feb 1998 15:25:36 -0800
Message-ID: <01BD3640.623E7870.cygnus.gnu-win32@localhost>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
To: "'Colin Peters'" <[email-masked]>
Cc: GNU-Win32 <[email-masked]>

You are right, I have to brush up my Win32 API knowledge (or avoid it).

Regards
Karl

-----Original Message-----
From:	Colin Peters [SMTP:[email-masked]]
Sent:	Tuesday, February 10, 1998 6:35 AM
To:	[email-masked]
Cc:	GNU-Win32
Subject:	Re: Set/GetWindowLong doesn't seem work

From: Karl Martin Syring <[email-masked]>
To: GNU-Win32 Mailing list <[email-masked]>
Date: Tuesday, February 10, 1998 1:43 PM

>Benny,
>cbWndExtra is declared as an int in the MS header, so there is no space
to
>reserve. Usually it it used as a pointer to the window specific data
>structures.
>A possible reason for Daniels problems may an error in the declaration of
the
>WNDCLASS structure. Perhaps he should download the real thing from the MS
SDK

I'm sorry, I couldn't let this one go by. The "cb" in cbWndExtra stands
for "count of bytes" (I didn't invent Hungarian notation, read Petzold)
and even in the "real" MS SDK cbWndExtra is an int. The variable indicates
the number of bytes which should be allocated as extra (for application
use, usually through GetWindowLong and the like) for each window of the
given window class when they are created. It is not a pointer. This is
reasonably clear (well, not *very* clear, but clear enough) in the MS SDK
documentation.

I sent basically the same advice to the original poster and got a response
back that it worked.

Colin.

[snip]
>-----Original Message-----
>From: Benjamin Riefenstahl [SMTP:[email-masked]]
>Sent: Monday, February 09, 1998 11:57 AM
>To: GNU-Win32 Mailing list
>Subject: Re: Set/GetWindowLong doesn't seem work
>
>Hi Daniel,
>
>
>Daniel Mironowicz wrote:
>> SetWindowLong(hwnd, 0, (LONG)hEdit);
>> And when i use GetWindowLong(hwnd, 0) to get edit handle I don't get
it.
>
>I think you forgot to reserve the space for that data. In the
>initialization of the WNDCLASS struct for the DocWindow, do
>
>    wnd.cbWndExtra = sizeof(LONG);

-- Colin Peters -- colin at fu.is.saga-u.ac.jp
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin
-- http://www.geocities.com/Tokyo/Towers/6162

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".