I have an MFC CButton in an MFC dialog that I'd like to give an icon to, in order to have a proper alpha channel for anti-aliasing, which bitmaps don't seem to offer.
I've set the buttons style to icon in dialog editor (there doesn't seem to be a specific facility for selecting an icon, so I guess it's done in code).
I found this reference on MSDN: http://msdn2.microsoft.com/en-us/library/bd24s672(VS.80).aspx
This cover's CButton's SetIcon() function.
The following example is given:
myButton.SetIcon( ::LoadIcon(NULL, IDI_QUESTION) );
This works for me - My CButton displays the system question mark icon. However, it does not work with my own icons that are imported into the project. I get the following compiler error:
error C2664: 'LoadIconA' : cannot convert parameter 2 from 'int' to 'LPCSTR'
A generic no conversion found error. Theres no point in doing an explicit typecast either.
What have I done wrong? What have I failed to appreciate?