Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-04-2011, 03:44 PM   #1
In Runtime
 
Join Date: Sep 2010
Posts: 240
Default Windows.h and Windows API

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

Thanks
__________________

TP-Oreilly is offline   Reply With Quote
Old 06-04-2011, 05:27 PM   #2
Daemon Poster
 
Join Date: Jun 2004
Posts: 511
Send a message via AIM to Denthúl Send a message via MSN to Denthúl Send a message via Yahoo to Denthúl
Default Re: Windows.h and Windows API

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.
__________________

Denthúl is offline   Reply With Quote
Old 06-04-2011, 07:47 PM   #3
Solid State Member
 
Join Date: May 2011
Posts: 18
Default Re: Windows.h and Windows API

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.
Sefrotox is offline   Reply With Quote
Old 06-05-2011, 08:06 AM   #4
In Runtime
 
Join Date: Sep 2010
Posts: 240
Default Re: Windows.h and Windows API

ok, so your saying the windows.h files contain the declaraions and the dll files contain the declarations?
TP-Oreilly is offline   Reply With Quote
Old 06-05-2011, 06:34 PM   #5
Solid State Member
 
Join Date: May 2011
Posts: 18
Default Re: Windows.h and Windows API

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;
}
Sefrotox is offline   Reply With Quote
Old 06-06-2011, 12:30 PM   #6
In Runtime
 
Join Date: Sep 2010
Posts: 240
Default Re: Windows.h and Windows API

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?
TP-Oreilly is offline   Reply With Quote
Old 06-06-2011, 04:54 PM   #7
Solid State Member
 
Join Date: May 2011
Posts: 18
Default Re: Windows.h and Windows API

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.
__________________

Sefrotox is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0