Posts

Showing posts from September 3, 2018

Using C++ Resource Files with Eclipse

Image
U sing a resource file in Eclipse is possible. While writing a blog about how to develop Windows programs using Eclipse and C++ I ran into a problem that I needed a tool for, namely to quote C++ code in the blog. So, I wrote a little program in C++ using the techniques I was discussing, but later I decided it would be an ideal project to rewrite using a resource file (.rc). There are a few things you have to do to get it to work. First, Eclipse doesn’t provide the slick resource file editor that you find in Visual C++. This means that to edit the .rc file you will need to use a text editor. This isn’t particularly hard to do, but I did find myself questioning whether I was gaining anything by using the resource file over just making the calls I needed in the C++ code. One thing that I can say that I don’t like is that you must use #define in the header file rather than defining constants with static const or as an enum . Second, the .rc file has to be compiled using a special compile