nanogui: Thread: CreateWindow fails...


[<<] [<] Page 1 of 1 [>] [>>]
Subject: CreateWindow fails...
From: Daniel Krippner ####@####.####
Date: 10 Jan 2002 09:58:18 -0000
Message-Id: <3C3D6468.2010702@gmx.net>

    Hello!

Another one: the following code... the second call to CreateWindow() 
fails, returning NULL. Is there anything like GetLastError() I think 
it's called in windows, any way I can know why the call does not work? 
Any other hints? Please help! :-)
    Daniel
   

      s_hwndVisu = CreateWindow(szClassName,
                                                        szWndName,
                                                        
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
                                                        0, 0, 0, 0,
                                                        NULL,
                                                        NULL,
                                                        hInstance,
                                                        NULL);
     
      if (s_hwndVisu != NULL)
        {
              s_hwndEditC = CreateWindow("EDIT",
                                                                    "OK",
                                                                    
WS_CHILD | WS_BORDER | ES_CENTER | ES_AUTOHSCROLL,
                                                                    0, 
0, 0, 0,
                                                                     
s_hwndVisu,
                                                                     NULL,
                                                                     
hInstance,
                                                                     NULL);
     
          if (s_hwndEditC != NULL)
            {
              if (prevWndProc == 0)
                    prevWndProc = (int(*)())GetWindowLong(s_hwndEditC, 
GWL_WNDPROC);
              SetWindowLong(s_hwndEditC, GWL_WNDPROC, 
(LONG)(WNDPROC)EditControlProc);
            }
        }

-- 
3S-Smart Software Solutions GmbH
Fischerstr.19, D-87435 Kempten
Tel. ++49-(0)831-54031-72
Fax ++49-(0)831-54031-50
email: ####@####.####
web:   http://www.3s-software.com


Subject: Re: [nanogui] CreateWindow fails...
From: "Greg Haerr" ####@####.####
Date: 12 Jan 2002 05:13:33 -0000
Message-Id: <028801c19b25$3d465800$3aba46a6@xmission.com>

Try creating the second window using szClassName rather
than EDIT and pass some regular WS_ values.  This will be
a quick check as to whether it's an edit box thing or something
to do with the parent/child relationship.  Check out src/demos/mwin/mdemo.c
for a working demo.

Regards,

Greg


: Another one: the following code... the second call to CreateWindow() 
: fails, returning NULL. Is there anything like GetLastError() I think 
: it's called in windows, any way I can know why the call does not work? 
: Any other hints? Please help! :-)
:     Daniel
:    
: 
:       s_hwndVisu = CreateWindow(szClassName,
:                                                         szWndName,
:                                                         
: WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
:                                                         0, 0, 0, 0,
:                                                         NULL,
:                                                         NULL,
:                                                         hInstance,
:                                                         NULL);
:      
:       if (s_hwndVisu != NULL)
:         {
:               s_hwndEditC = CreateWindow("EDIT",
:                                                                     "OK",
:                                                                     
: WS_CHILD | WS_BORDER | ES_CENTER | ES_AUTOHSCROLL,
:                                                                     0, 
: 0, 0, 0,
:                                                                      
: s_hwndVisu,
:                                                                      NULL,
:                                                                      
: hInstance,
:                                                                      NULL);
:      
:           if (s_hwndEditC != NULL)
:             {
:               if (prevWndProc == 0)
:                     prevWndProc = (int(*)())GetWindowLong(s_hwndEditC, 
: GWL_WNDPROC);
:               SetWindowLong(s_hwndEditC, GWL_WNDPROC, 
: (LONG)(WNDPROC)EditControlProc);
:             }
:         }
: 
: -- 
: 3S-Smart Software Solutions GmbH
: Fischerstr.19, D-87435 Kempten
: Tel. ++49-(0)831-54031-72
: Fax ++49-(0)831-54031-50
: email: ####@####.####
: web:   http://www.3s-software.com
: 
: 
: 
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: ####@####.####
: For additional commands, e-mail: ####@####.####
: 

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.