ExtractIconEx problem

Hey guys,
I'm currently developing a windows app for WM5 PPC, and need to load an icon from a file. Having done this without problems in PC windows before, I wrotemade the following code:

HICON hicon = NULL;
if (!(hicon = ::ExtractIconEx(_T("\\Program Files\\ProtoApp\\icon2.ico"), 0, NULL, &hicon, 1))){
.....
//some error handling code
}

The icon file in question is definitely there; I've checked over and over, with someone else to make sure, that the path is absolutely correct without spelling. The icon was made in VS2005, and contains exactly ONE icon 16x16 with 16 colors (which is recognized as the system metric's specifications for small icons). I can open the icon on the device and it displays fine in internet explorer, so it is not corrupt in any way. Yet, this code fails everytime, the error message after FormatMessage being "The specified resource name cannot be found in the image file.". Is there something I should know about loading icons from files on WM5 Thanks in advance.


Answer this question

ExtractIconEx problem

  • talha zia

    Ah, nevermind then. The first argument path must be to an exe or dll in windows mobile 5, rather than an ico file itself.

  • ExtractIconEx problem