Results 1 to 24 of 24

Thread: How to use API in C++

  1. #1

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    Arrow

    HI, sinc i am pretty new to C++ I am reading all the threads and I have learned alot. Although I am seeing people talking about API and programing APi for C++ and things like that. Since I am pretty good in VB and I use alot of API, I was wondering is API in C++ same as API in VB.
    I guess sounds little stupid, well what I mean is. Does C++ have a API viewer like VB has. I really appreciate if I get a little explanation about API's with C++ and how to sue them.

    Thanks in Advance
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    In C++ you just #include <windows.h> and use API's without declaring them. There is no API viewer but you don't need one beacuse the API functions don't have to be declared. Use the MSDN to get info about the parameters of the API Functions and their use.
    Example:
    Code:
    #include <windows.h>
    //call apis
    Sleep(2000);
    long tm = GetTickCount();
    .....
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    Thumbs up

    I have msdn cd's although I am not going to install them. I would look for what you said in msdn online, although what kind of keyword I am seppose to look for?
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    http://msdn.microsoft.com/library

    You need the Platform SDK -- this is basically the API documentation and a whole lot more

    As for keywords, just think of what you want to do. Need to use a file? OpenFile seems fair enough...so you go to that page...and MS says it's been superseded by CreateFile

    Hehehehe.....they never said it would be simple
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    Cool Thanx

    Thanks alot for the tip. I think I have SDK-Platform and I think it is version 5.0.
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    They're not given in versions - the latest Platform SDK is the Whistler Beta 1 Edition at http://www.microsoft.com/msdownload/...uplauncher.htm
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    I got it.

    Yeah I think that is the one I got. Although I was just wondering what is windows whistle or something like that. I saw you guys where talking about it in Chitchat Forum and I saw couple of screen shots if I am not mistaking.

    i.e. I am using Windows 95
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Whistler is Microsoft's new OS...and seems quite interesting, but I'll only be bothering if they get the hardware stuff sorted out

    Since you're on Windows 95, pay special attention to the information in the PSDK about what functions are supported on what versions of Windows -- for example some things are supported on 98 but not 95.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    Exclamation can it be integrated with my current platform?

    so does that mean this is a new OS by it self? What I mean is that can it be integrated with win95? Also I heard that it is going to be released by the end of this year. How did you guys manage to get it now??
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    No. It is a separate OS and cannot be integrated with any other, whether it is 95, 98, 2000 or ME.

    I don't have a copy, but at least one person does...he uploaded some screenshots.

    Anyway -- it's still in beta so it's not for sale yet, but MSDN subscribers may have it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    Lightbulb so its not a reliable one yet.

    So the OS is not as reliable as other window's yet. Right?? Although do you have any idea about the price when microsoft release this OS? Also is it going to effect C++ functions and other porgramming languages??
    ===========================
    Kourosh Gonabadi
    VB Programmer
    C++ Newbie
    Graphic Designer
    ===========================

  12. #12
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    it is probably going to be more expensive than windows me was, but less expensive than win2k (at least for the basic edition). I don't know for sure, but i think that it is based on the NT kernal, and that it will run all old windows software, not directly but through emulators. So i think your win95 c++ stuff is safe for now, but i am sure after a few years they will drop windows 95/98/ME off the face of the planet as they did with win 3.1.

  13. #13
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Why are they trying to do this?????? Why not make it compatable with the old software? Does this bring up speed issues and stuff like that?

  14. #14
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    I don't know why they are doing it. as far as i know it is going to completly eliminate DOS, and is going to be based on the NT kernal. I am almost positive that it is not going to be realeaed by the end of this year, and may not even be realesed in 2002.

    Whistler is completly different from 95/98/me from the ground up. The only reason that i can think that they would use emulators is because of the new 64 bit machines coming out. But who knows!

  15. #15
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    oh and as far as speed, processor speed has more than doubled since last year, and if they come out with whistler in 2002, who knows, maybe computers will be running at 2 GHZ!? I think they just might get away with it.

  16. #16
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Will it be different programming? Because if they have the emulator, and (at least somewhat) the same programming I'm all for it.

  17. #17
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    DAMN! and I just bought my new computer last feb. its 500 mghz DVD ROM, 64 RAM (getting 128 more in a week)....and now they're up to 2 ghz!!!!!!!!!!!!!! DAMN! GRRRRRRRRR


    Oh by the way...I heard the Win 2K console has scrollbars. Is it possible that someone could send it to me and this could take over as my normal console?

  18. #18
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i have win2k, and the console does have scrollbars. I can send it to you, but i am not guarnteeing that it will work. How do you want me to send it?

  19. #19
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Talking

    Yes Thanks!

    [email protected]

    Yes I know...aol sucks...but my family can't use this machine without it

  20. #20
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I doubt it will work - I expect it will whinge about Unicode support if you try and use cmd.exe on a non-NT system (if it dies with a missing export function ending in "W", then that's the problem).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  21. #21
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    didn't...but thanks for sending it anyway

  22. #22
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217

    Come To Think Of IT

    Come to think of it, didn't Microsoft promise win 2000 would remove dos a few years back? Not that I care, I use Unix and Win2Lin now.
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  23. #23
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Win2K doesn't have DOS. It merely has a program that acts as a command interpreter.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  24. #24
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    actually, i think that while the dos use is limited, it does still use it to some extent. there is a hidden msdos 7 folder in the root directory. That could be just for making the bootdisk or backup or something though.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width