bgroenks
bgroenks

Reputation: 1889

Can the Windows API be utilized using just C?

I'm in the process of teaching myself C (coming from Java). I appreciate the language a lot, and one of the main reasons I am learning it is so that I can utilize the JNI feature built into Java to write native code when necessary. My question is mainly about the Windows API. Can I use the functions and features of the API using just C?

Will the Windows API be compatible with pure C code or does it contain classes and such that can only be utilized by C++ code?

Also, if I compiled a shared library on a Windows machine as (lib.sl NOT lib.dll), would it work on another machine (Mac/Linux)?

Upvotes: 1

Views: 319

Answers (2)

Viju
Viju

Reputation: 101

Win32 API like others have pointed out is pure C. It means, once you get a hold of it, you will know everything about how the Operating system works. It is the same case usually with other operating systems as well. If you are after MFC/COM+ or Java wrappers, it is quite the opposite even if you can build great programs.

Upvotes: 0

cli_hlt
cli_hlt

Reputation: 7164

  1. The Windows API (aka Win32 API) is a pure C library.
  2. No you cannot use a Windows shared library on another non-Windows machine unless there is a software that supports Windows ABI - such as Wine or ReactOS.

Upvotes: 7

Related Questions