Windows.h and Windows API

TP-Oreilly

In Runtime
Messages
240
Hi, im a little confused...

...What is it which gives us windows functions. Is it the windows.h header file which allows us to use windowss functions or is it the windows API which allows us to use windows functions (the dll files which form the API)?

So i am getting confused in the differences between the Windows API (the dll files) and the windows.h header files and what they actually do for us.

Please answer as simple as possible :D

Thanks
 
The header file contains the declarations for the functions and stuff that form the API. Someone correct me if I'm wrong, but the DLLs are just that (and other source files) compiled in to a binary form. Not the best explanation, but hopefully it makes sense.
 
I think what Denthul is explaining is correct. windows.h does hold the declarations, I believe. So in essence it is basically part of the API, or is the API. You will also need to have static linked library files (.lib) loaded in via the compiler linker as they will be needed to compile. They will usually contain definitions. As for .dll (dynamic link library) files, these are similar to static library files, however, they get linked to the executable during run time. Hopefully I said all that correctly. :)
 
:) ok, so your saying the windows.h files contain the declaraions and the dll files contain the declarations?
 
Usually the header files contain the prototypes and the library files contain the actual definitions. For example:

header.h
Code:
double sum(double, double);

compiledLib.lib/dll
Code:
double sum(double a, double b)
{
    return a + b;
}
 
Ok :) so the windows.h files is the declarations and the dlls are the definitions :)

What actually is the Windows API, is it the windows.h file or the dll files, or a compilation of both which form it?
 
Well API stands for application programming interface, so defining exactly what it is may be hard. I would say, though, that when you are including windows.h you are including the API, or simply an API. I would also say that the library files are "part" of the API. So then, why not say that the API is what comes both from the declarations and definitions. :)
 
Back
Top Bottom