user32233
user32233

Reputation: 43

Windows API functions

Are they standard code c or c++ code? what are they?

Upvotes: 4

Views: 315

Answers (4)

Hans Passant
Hans Passant

Reputation: 942368

The original Win32 API is C-based. There are however a substantial number of services within Windows that are COM based. Good examples are the clipboard, drag+drop, the shell, the user mode driver framework, DirectX. While it is technically possible to write COM code in C, it is excruciatingly painful to do so.

Realistically you use C++ there. And a C++ class library to make the original C-based API less painful, especially for GUI code.

Upvotes: 5

Al Kepp
Al Kepp

Reputation: 5980

Windows API is langugage neutral. It is neither C nor C++. Microsoft says that Windows itself is written mainly in C++, but you don't need any classes for vast majority of the API and even classes in API (e.g. in Direct X) can be used in pure C without classes.

Although some C programmers think it is a C library, compiler of a programming language must support proprietary Windows calling model, it is not a classic C calling convention. (Obviously almost each real world C compiler supports it nowadays.)

Upvotes: 0

darioo
darioo

Reputation: 47213

They're standard C code, if you're programming against pure Windows API.

A C++ based wrapper called MFC is available.

All of this is being pushed out in favor of .NET framework.

Upvotes: 2

orlp
orlp

Reputation: 117886

The standard Windows API is a C library. Wrappers exist for other languages (C++, etc).

Just read it on wikipedia.

Upvotes: 0

Related Questions