Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29390 Discussions

Compiling Resources that Include Windows.h

Michael8
Beginner
2,977 Views
Hello:

We have some resource files (*.rc) that include windows.h at the top. Some of the users in our office have the full Visual Studio 2008, and the resource files compile without a problem. Other users only have the Visual Studio 2008 Shell and the resource compiler complains when trying to compile the .rc file because it can't find windows.h.

First of all, is it correct that the VS2008 Shell does not include windows.h, or maybeis there something that needs to be fixed withthe include paths?

Secondly (assuming that the VS2008 Shell does not include windows.h), what is the best/proper fix for this- to download the Windows SDK for each of these machines? (If so, which version of Windows SDK?)

Thanks.
Michael
0 Kudos
9 Replies
TimP
Honored Contributor III
2,977 Views
Isn't a C++ include file? ifort with VS2008 Shell has no C++ capability. So, I don't understand how you would be using windows.h.
0 Kudos
Michael8
Beginner
2,977 Views

The resource file was created by ResEdit (since VS2008 Shell doesn't have a resource editor). The person who created the resource file had to copy over Windows.h from a different machine, since ResEdit includes it at the top of the .rc file. Now that the resource file has been created, it is being used by others in the office. But those that have VS2008 Shell don't have windows.h.

That's why I'm wondering the best way to obtain it, or work around this problem. We can tell ResEdit not to put the #include line at the top, but the code it creates apparently needs this.

Thanks.
Michael

0 Kudos
Wendy_Doerner__Intel
Valued Contributor I
2,977 Views

Michael,

The Microsoft* Visual 2008 Shell that we ship with our product does not have a C++ compiler as Tim mentions or other full features such as the Resource Editor. We recommend the following ResEdit*, a third-party tool, for a substitute (and it recommends downloading a Windows* Platform SDK to obtain windows.h). See our release notes for a list of Windows* Platform SDK's we support and would be compatible with your OS version.

------

Wendy

Attaching or including files in a post

0 Kudos
Michael8
Beginner
2,977 Views
Hello:

Thanks for your reply. Yes, we are using the ResEdit software. I guess we never noticed that it recommends downloading the Platform SDK. That would probably have made things simpler in setting up ResEdit. I'll look at the Release Notes and see if I can getthis straightened out.

Thanks.
Michael
0 Kudos
Jugoslav_Dujic
Valued Contributor II
2,977 Views
One tiny catch is that Platform SDK download is ~300 MB, of which you effectively need ~200 kB in windows.h and its descendents. Of those, (as far as I know), ResEdit uses several tens or hundreds of #defined constants.

I don't think there's a way to get the "lite" version of Platform SDK, though. For XP Platform SDK 6.0A, the zipped versions of /Include and /Lib folders (which is all that Intel Fortran+ResEdit need) take < 20 MB together. Alas, it is not legal to redistribute them, as far as I know (although the complete download from Microsoft is free).
0 Kudos
Steven_L_Intel1
Employee
2,977 Views
You are correct - redistribution of the SDK is not allowed. We're actually talking to MS about their allowing us to do so, which would provide many benefits (such as being able to include the VS Shell for evaluations), but the downside is that it is huge, as you say. I've seen 1GB mentioned, though they have a web installer that allows you to cut that down. Right now, we pay a royalty to redistribute pieces of Visual C++ that are also in the SDK, but this has to be specially packaged.
0 Kudos
Michael8
Beginner
2,977 Views
I've found a nice workaround that works for us and does not require downloading any of the SDK. I don't understand this stuff well enough to guarantee that it will work for others, but I figured I would post it here, in case it is useful.

In ResEdit, we just changed the include path to use the following 2 directories:
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include
C:\Program Files\Microsoft Visual Studio 9.0\VC\PlatformSDK\include

The other thing we changed in ResEdit is the "Resource script template". We commented out the 3 includes: windows.h, commctrl.h, and richedit.h; and then added a new one: afxres.h.

Now, ResEdit produced resource files that can be compiled the Microsoft Visual Studio Shell without a problem. I hope this is helpful to others.

Thanks.
Michael
0 Kudos
Jugoslav_Dujic
Valued Contributor II
2,977 Views
I see. I didn't even know that VS Shell comes with those directories.

Now, it depents what stuff will ResEdit generate for you in the .rc file. I don't have a time to check, but there are generally two possibilities: Visual Studio will use symbolic identifiers for styles and default IDs, e.g.

[bash]IDD_DIALOG_ABOUT DIALOGEX 0, 0, 186, 58
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION |
    WS_SYSMENU
...
    DEFPUSHBUTTON   "OK",IDOK,67,38,50,14
[/bash]
These symbolic constants (DS_SETFONT, WS_POPUP, IDOK et al.) are imported into afxres.h through #include , which #includes , which contains

[cpp]#include 
#include 
#include 
#include 
#include 
#include 
[/cpp]

Well, these files contain the mentioned symbolic constants. Do you have them in that PlatformSDK directory? If yes, your problem is likely solved.

(There's a possibility that ResEdit does not use symbolic names, but hard-wired numbers; the resulting .rc file might be valid, but is human-unreadable. Didn't check though.)
0 Kudos
Michael8
Beginner
2,977 Views
Yes, it looks like the PlatformSDK directory does include all those filesthat you listed above. And the .rc file does use the symbolic constants. So I think it all works out.

Thanks.
Michael
0 Kudos
Reply