Can anyone explain why my simple, 9-lines code do not compile?

#include "windows.h"
#include "stdio.h"

int main(){
HINSTANCE dll_handler;
if (dll_handler = LoadLibrary("theDLL.dll")){
printf("DLL LOADED!!");
}
getchar();
}
All I did was create a new "Empty Project" using Visual C++ (Express Edition 2005) and created a file called main.cpp, there are no other files except for main.cpp

In main.cpp, I inserted the code above. But when I tried to compile it, I got compile errors. After a few modification and more errors, I have found 2 occuring errors:

1. Cannot open include file: 'windows.h': No such file or directory
I don't get it, I've seen other people doing that so why can't I. I'm pretty sure that I'm not missing the header file, because I can successfully include windows.h if I were to use New > Win32 Program. What must I do to be able to include windows.h ?

2. 'HINSTANCE' : undeclared identifier
I've seen people declaring HINSTANCE type variables, how do they do that? What am I missing to be able to use it?

The program was supposed to simply load a dll file, but since I'm new and clueless to the c++ language I had no idea what went wrong.

btw, the program works (compiles and runs successfully) if I remove the #include windows.h part and the HINSTANCE variable declaration along with the dll-loading part.
[1424 byte] By [dadads] at [2007-11-20 1:27:46]
# 1 Re: Can anyone explain why my simple, 9-lines code do not compile?
Have you tried <windows.h> instead of "windows.h" ?
Niels_Boar at 2007-11-10 23:18:19 >
# 2 Re: Can anyone explain why my simple, 9-lines code do not compile?
Yea, "windows.h" tells the compiler to look in the current directory for windows.h where your programs source code is. Your program should look like this:


#include <windows.h>
#include <stdio.h>

int main(){
HINSTANCE dll_handler;
if (dll_handler = LoadLibrary("theDLL.dll")){
printf("DLL LOADED!!\n"); //don't forget to add a newline or your output will look nasty!!
}
getchar();
}
soylentgreen448 at 2007-11-10 23:19:25 >
# 3 Re: Can anyone explain why my simple, 9-lines code do not compile?
#include <windows.h> does not work either.

.\main.cpp(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

I'm guessing that there are some settings that I missed.
dadads at 2007-11-10 23:20:29 >
# 4 Re: Can anyone explain why my simple, 9-lines code do not compile?
VS 2005 Express does not include the platform SDK by default.

You need to install the platform SDK and configure VS's directories so that it knows how to use it.

See "Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK" at http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

Mike
MikeAThon at 2007-11-10 23:21:23 >
# 5 Re: Can anyone explain why my simple, 9-lines code do not compile?
oo, i see.
What a weird, non programming-related problem. Got me confused for 1 whole day.
dadads at 2007-11-10 23:22:29 >