Re: [Dev-C++] conversion from void *(and is neither void nor pointer)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Napoleon A. <nah...@so...> - 2002-07-06 16:40:28
|
Hi there, There solution to your problem can be found at http://www.relisoft.com/forum check Windows API Programming in C++. Below is an excerpt of the discussions that went on. ..... The hInstance member of _class is a HANDLE (that is, _class is a WNDCLASSEX, and WNDCLASSEX's 'hInstance' member is a HANDLE, not, as one might guess from it's name, an HINSTANCE). mingw does define HANDLE as a pointer to void. But LoadImage is looking for an honest-to-god HINSTANCE. There is also a solution on the forumwhich works fine on Dev-C++. Napoleon. ----- Original Message ----- From: "Carlos García del Monte" <cg...@wo...> To: "dev-cpp-users-list" <dev...@li...> Sent: Saturday, July 06, 2002 11:58 AM Subject: Re: [Dev-C++] conversion from void *(and is neither void nor pointer) > Thanks, it works in some sites, but now I have found a place where it is a 0 > in LoadImage, and it still says that, the parameter expected is an UINT, I do > everything but no way! > > Here is the line: > _class.hIcon = reinterpret_cast<HICON> ( > ::LoadImage (_class.hInstance, > MAKEINTRESOURCE (resId), > IMAGE_ICON, > ::GetSystemMetrics (SM_CXICON), > ::GetSystemMetrics (SM_CYICON), > 0)); > > I changed the first with _class.hIcon = ::LoadIcon(_class.hInstance, > MAKEINTRESOURCE(resId)); and it says the same error. The same if I put 1-1 > instead of 0, or if I declare a UINT var = 0; and write var. I use the > LR_DEFAULTSIZE flag and still says that. > Here is the code of the full function where the two lines still have error > are: > > void WinClass::SetResIcons (int resId) > { > UINT zero = 0; > _class.hIcon = reinterpret_cast<HICON> ( > ::LoadImage ( > _class.hInstance, > MAKEINTRESOURCE (resId), > IMAGE_ICON, > ::GetSystemMetrics (SM_CXICON), > ::GetSystemMetrics (SM_CYICON), > 0)); > // Small icon can be loaded from the same resource > _class.hIconSm = reinterpret_cast<HICON> ( > ::LoadImage ( > _class.hInstance, > MAKEINTRESOURCE (resId), > IMAGE_ICON, > ::GetSystemMetrics (SM_CXSMICON), > ::GetSystemMetrics (SM_CYSMICON), > 0)); > } > > Borland 5.5 compiles fine, but I prefer Dev, it's more comfortable IDE than > those I found for Borland, with difference. > > P.S.: Some times the error has lines where the error is unreadable characters. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Got root? We do. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.372 / Virus Database: 207 - Release Date: 20/06/02 |