Subject: Re: Set/GetWindowLong doesn't seem work
From: [email-masked] (Benjamin Riefenstahl)

9 Feb 1998 03:19:44 -0800
Message-ID: <[email-masked]>
References: <01bd3483$cd981c20$LocalHost@ppp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: GNU-Win32 Mailing list <[email-masked]>

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);

Other things I notice:

- You call GetWindowLong() on your MDI frame once, but you never set
anything in that window. You should probably rename your variables to
make sure you know which of your three HWNDs you are dealing with in
each place.

- You should memset() all structures to 0 before using them. It's a good
habit to get into with structures, especially with those that you didn't
define yourself. I got bitten by that one precisely with WNDCLASS.

- In Win/32 you can call GetLastError() if *anything* fails. This gives
you a hint most of the time (at least it does for me).

so long, benny
======================================
Benjamin Riefenstahl ([email-masked])
Crocodial Communications EntwicklungsGmbH
Ophagen 16a, D-20257 Hamburg, Germany
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".