If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
I am porting a pretty large MFC project to wxWidgets. I read the sample code named "mfc" and found that wxWidgets can someway work together with MFC. This is good for me to devide the porting effort into two parts: UI and GDI. But i encountered compiling problem later because wxWidgets undefined some windows API declarations(in Defs.h) like DrawText, StartDoc and so on, and the undefining also affect MFC classes with the same name of these APIs.
now i am confused, why wxWidgets need to do this?
waterj wrote:now i am confused, why wxWidgets need to do this?
Although I can't answer this specific question and I don't have the time to dig through the code (which I would, as this is an interesting question), I think the solution might be to include winundef.h located in include\wx\msw. It should undef the defines by windows.h and add the correct function prototypes for each build.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
AFAIK (i read it somewhere) its because some of the win32 API function names conflict with the wx ones (hint hint, namespaces ) so winundef.h would undefine them so it wont conflict with the wxwidgets ones