cannot convert ‘LPFINDREPLACE {aka FINDREPLACEA*}’ to ‘LPFINDREPLACEW

18Jul14

Problem

include/wx-3.0/wx/msw/winundef.h: In function 'HWND__* FindText(LPFINDREPLACE)':
include/wx-3.0/wx/msw/winundef.h:126:43: error: cannot convert 'LPFINDREPLACE {aka FINDREPLACEA*}' to 'LPFINDREPLACEW {aka FINDREPLACEW*}' for argument '1' to 'HWND__* FindTextW(LPFINDREPLACEW)'
             return FindTextW(lpfindreplace);

Solution

In msw/winundef.h, LPFINDREPLACE needs to be defined as LPFINDREPLACEW if _UNICODE is defined i.e.

#define LPFINDREPLACE LPFINDREPLACEW.

This probably doesn’t address the root cause of the problem but as a quick fix you could try defining it before winundef.h is included or patch winundef.h with the following code after #undef FindText

#ifdef _UNICODE
#define LPFINDREPLACE LPFINDREPLACEW
#else
#define LPFINDREPLACE LPFINDREPLACE
#endif


No Responses Yet to “cannot convert ‘LPFINDREPLACE {aka FINDREPLACEA*}’ to ‘LPFINDREPLACEW”

  1. Leave a Comment

Share your knowledge