Thread: how do you call api calls

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    2

    how do you call api calls

    ?

  2. #2
    Unregistered
    Guest
    you write a program

    Start by looking at sample code and tutorials. It takes alot to write a windows program.

    mainly sample code:

    http://www.foosyerdoos.fsnet.co.uk/

    programming windows in C:

    http://www.winprog.org/tutorial/ (one of my favorite tutorials)
    http://sunlightd.virtualave.net/default2.htm (decent tute, doesn't explain much though)

    programming windows in C++:

    http://www.relisoft.com/win32/index.htm (good tute, somewhat unorganized though)

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    programming windows in C:

    http://www.winprog.org/tutorial/ (one of my favorite tutorials)
    This is not entirely true, if you didnt notice, they use C++ style comments, making it a "Programming Windows in C++" tutorial
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  4. #4
    Unregistered
    Guest
    OK, programming in C, but using C++ comments

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> how do you call api calls

    Include the appropriate header, (usually windows.h is good enough, but the help will tell you which include file necessary for each routine), then you can call them in exactly the same way as your own functions.

    Note, calling API functions if you don't know what you are doing can be damaging to your mental health - see notes above about tutorials.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    >> OK, programming in C, but using C++ comments
    lol i guess that works

    I didnt think there was a difference between C Win32 API Programming and C++ Win32 API Programming..
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by Okiesmokie
    >> OK, programming in C, but using C++ comments
    lol i guess that works

    I didnt think there was a difference between C Win32 API Programming and C++ Win32 API Programming..
    There isnt.........you can write to API functions in almost any language as long as the language can do certain key things....Hell.....its easy enough to call API funcs in Assembler as long as you know what you are doing.....

  8. #8
    Unregistered
    Guest
    The main difference is simply the fact it's in C++

    You can't use classes and encapsulation and so forth in regular C. There is a difference, but only because of the differences in the languages. If you know C++ well enough, it's obviously the way to go, but if not, C is easy enough.

  9. #9
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    yea, i was looking at that C++ one, but if i wanted to use classes, i would just use MFC.

    When i write a win32 App, i use 2 functions:

    int WINAPI WinMain(..);
    LRESULT CALLBACK WndProc(..);
    "There are three kinds of people in the world...
    Those that can count and those that can't."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inline asm
    By brietje698 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2007, 02:54 PM
  2. Logic problems
    By Beowolf in forum C++ Programming
    Replies: 29
    Last Post: 10-31-2007, 08:36 AM
  3. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 06:51 PM
  4. gotoxy API call in MS VC++, pauses?!?!
    By bennyandthejets in forum C++ Programming
    Replies: 6
    Last Post: 07-11-2002, 07:28 PM
  5. Assembly example
    By Lynux-Penguin in forum C Programming
    Replies: 6
    Last Post: 04-24-2002, 07:45 PM