Smash
Smash

Reputation: 3802

CMFCButton compilation error

I want to use a CMFCButton. When I compile, I get this error:

afxbutton.h(183): warning C4003: not enough actual parameters for macro 'SelectFont'
afxbutton.h(183): error C2226: syntax error: unexpected type 'HFONT'

It seems to be in conflict with a windows macro: Windows SelectFont() Macro

How can I fix this ?

Upvotes: 2

Views: 1772

Answers (1)

demoncodemonkey
demoncodemonkey

Reputation: 11957

SelectFont is defined in Windowsx.h. To resolve the conflict, find any #include for Windowsx.h in your project and move it after the #include for the MFC controls. Maybe to the end of your stdafx.h.

The same problem can be seen here (note BCGSoft is the company that created the MFC controls, so the same situation applies)

Upvotes: 3

Related Questions