Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Having my HWND and eating it, too...
Re: Having my HWND and eating it, too... [message #12097 is a reply to message #12095] Wed, 10 October 2007 21:56 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
From where do you get a handle to your window?
If it is your applications main window, (if you are using e.g. mainwindow.run()) you shouldn't try to get a handle to your window in class constructor (unless you explicitly call Open() or OpenMain() -- which, in this case (if you already call run() in your apps main()) you shouldn't use).

You could use instead something safer:

HWND MainWindow::GetHandle()
{
return GetHWND(); // use IsOpen() to check before calling;
}

or

HWND MainWindow::GetHandle()
{
return IsOpen() ? GetHWND() : null; // handle null as an error;
}

and call whenever it's needed.


[Updated on: Wed, 10 October 2007 22:14]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon3.gif
Read Message
Previous Topic: Toolbar clears after ESC key [solved, it`s the bug in user code]
Next Topic: label text not wrapped
Goto Forum:
  


Current Time: Tue Jun 10 14:11:50 CEST 2025

Total time taken to generate the page: 0.04024 seconds