In a Visual C++ program, visual elements in your program (menus, dialog boxes, bitmaps, icons, and some strings) are defined in a source file with the extension .RC, which is referred to as a resource script. This file is compiled and 'linked' into your program. The term "resources" refers to these visual elements.
As a first step I would suggest googling on the topic "Breaking changes in Visual C++" and see what turns up. Between version 6 and 8 MS have increased C++ standards compliance, so some older code may well be broken.
can you tell me what type of application are you working on?
MFC , Console or On something else because I tried executing your code in MFC application and apart from a very minor change I was able to get the result.
Somethings seem HARD to do, until we know how to do them.