I´m using the a CStatic object to hold an icon. I want to change it
dynamically. The problem is that when the program is linked throws this error:
error LNK2019: unresolved external symbol "public: struct HICON__ * __cdecl
CStatic::SetIcon(struct HICON__ *)"
The line is:
pStaticWnd->SetIcon(::LoadIcon(NULL, MAKEINTRESOURCE(IDI_SAMPLE)));
Does anyone knows a way to fix it?
Thanks
--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-vc/200906/1
http://guruce.com/blogpost/howtoaskquestionsonnewsgroups
In particular, Windows CE version, MFC/Visual Studio version, *what* you're
actually trying to do (change the icon shown on the task bar?)
Paul T.
"FmF via PocketPCJunkies.com" <u49788@uwe> wrote in message
news:9861972a07573@uwe...
I´m developing in Windows CE 5.0
As I said in my post, I´m using a CStatic control to display an ICON.
The CStatic class provides a method "SetIcon" to set an icon.
The program compiles successful but I can't link it because of this error:
error LNK2019: unresolved external symbol "public: struct HICON__ * __cdecl
CStatic::SetIcon(struct HICON__ *)"
Paul G. Tobey [eMVP] wrote:
>Take a look at this page and try to give us complete information with your
>posts:
>
>http://guruce.com/blogpost/howtoaskquestionsonnewsgroups
>
>In particular, Windows CE version, MFC/Visual Studio version, *what* you're
>actually trying to do (change the icon shown on the task bar?)
>
>Paul T.
>
>> Hello,
>>
>[quoted text clipped - 13 lines]
This appears to me to be the standard case of MFC is a piece of $#&@. You
need to send the STM_SETIMAGE message to your control, passing, in the
WPARAM parameter either IMAGE_ICON or IMAGE_BITMAP (icon, in your case), and
the icon image in the LPARAM parameter:
HICON icon = LoadIcon( g_hInst, MAKEINTRESOURCE(IDI_MYICON) );
SendDlgItemMessage( hDlg, IDC_MYSTATIC, STM_SETIMAGE, IMAGE_ICON,
(LPARAM)icon );
I'm unable to figure out how you event got something to compile with a call
to
pStaticControl->SetIcon( icon );
As far as I can tell, the SetIcon() method should take two parameters, an
HICON and a BOOL.
Paul T.
"FmF via PocketPCJunkies.com" <u49788@uwe> wrote in message
news:98621b969ab43@uwe...
But i worked if i send STM_SETIMAGE message.
Thanks!,
FmF
Paul G. Tobey [eMVP] wrote:
>Ah, it wasn't clear that you meant an instance of a STATIC window by that!
>
>This appears to me to be the standard case of MFC is a piece of $#&@. You
>need to send the STM_SETIMAGE message to your control, passing, in the
>WPARAM parameter either IMAGE_ICON or IMAGE_BITMAP (icon, in your case), and
>the icon image in the LPARAM parameter:
>
>HICON icon = LoadIcon( g_hInst, MAKEINTRESOURCE(IDI_MYICON) );
>
>SendDlgItemMessage( hDlg, IDC_MYSTATIC, STM_SETIMAGE, IMAGE_ICON,
>(LPARAM)icon );
>
>I'm unable to figure out how you event got something to compile with a call
>to
>
>pStaticControl->SetIcon( icon );
>
>As far as I can tell, the SetIcon() method should take two parameters, an
>HICON and a BOOL.
>
>Paul T.
>
>> Ok,
>>
>[quoted text clipped - 25 lines]
Paul T.
"FmF via PocketPCJunkies.com" <u49788@uwe> wrote in message
news:986d25ec13d5c@uwe...
// Window control functions
_AFXWIN_INLINE CStatic::CStatic()
{ }
WCE_DEL _AFXWIN_INLINE HICON CStatic::SetIcon(HICON hIcon)
WCE_DEL { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd,
STM_SETICON, (WPARAM)hIcon, 0L); }
The macro WCE_DEL excludes the method SetIcon from MFC library. That's why it
compiles successfuly but i´m not able to link the program.
Anyway, it works with STM_SETIMAGE
Paul G. Tobey [eMVP] wrote:
>It just means that this version of MFC, for this version of Windows CE,
>probably does not override SetIcon() in the CStatic class, so you're just
>using the one from CWindow (or is it CWnd? Stupid design). That one used
>WM_SETICON, which doesn't do what you want for a STATIC control.
>
>Paul T.
>
>> Yes, i´m using MFC. It seems not to work on MFC.
>>
>[quoted text clipped - 33 lines]
>>>>>>
>>>>>> Thanks
--
Message posted via http://www.pocketpcjunkies.com
Paul T.
"FmF via PocketPCJunkies.com" <u49788@uwe> wrote in message
news:986d89f2b1dd6@uwe...