CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2004
    Posts
    53

    int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Hello!

    i m a student doing my Final Year Project. i m given a software task using Visual C++ to make an application running a Bluetooth device. Though i m familiar with C and C++, i m very new to Visual C++..

    i m given thousands of lines of code to look at now.. though i can recognise the language, there are many things that are unfamiliar to me

    int WINAPI WinMain(...) { ... }

    Can anybody tell me what is WINAPI? Why is it declared after the type and before the function name?

    i have checked up Microsoft MSDN site and searched the forum here but to no positive results..

    hope brothers here can help me~ thanks!!

  2. #2
    Join Date
    Feb 2002
    Posts
    3,788

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    From MSDN:

    WINAPI - Use in place of FAR PASCAL in API declarations. If you are writing a DLL with exported API entry points, you can use this for your own APIs.
    Obsolete Calling Conventions
    Home | Overview | How Do I

    The __pascal, __fortran, and __syscall calling conventions are no longer supported. You can emulate their functionality by using one of the supported calling conventions and appropriate linker options.

    WINDOWS.H now supports the WINAPI macro, which translates to the appropriate calling convention for the target. Use WINAPI where you previously used PASCAL or __far __pascal.
    WINAPI - Calling convention for the Win32 API.

  3. #3
    Join Date
    Sep 2004
    Posts
    53

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    thanks Alin,

    but what does this line mean anyway then?

    WINAPI - Calling convention for the Win32 API

    why is the macro placed between the type and function name?

  4. #4
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Functions in C++ can use different calling convetions.

    Calling conventions describe how the argumens of the functions are passed ( in which order etc), name decoration etc.

    Check MSDN for "calling conventions" and you will find out much more details about these topics.
    Har Har

  5. #5
    Join Date
    Mar 2004
    Posts
    5

    Talking Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    WINAPI = __stdcall
    that's the calling convension for windows api

  6. #6
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Ure right click->Go to definition to look at the definition of any unknown identifier.
    "Programs must be written for people to read, and only incidentally for machines to execute."

  7. #7
    Join Date
    Sep 2004
    Posts
    5

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Quote Originally Posted by overtime_e
    Hello!

    i m a student doing my Final Year Project. i m given a software task using Visual C++ to make an application running a Bluetooth device. Though i m familiar with C and C++, i m very new to Visual C++..

    i m given thousands of lines of code to look at now.. though i can recognise the language, there are many things that are unfamiliar to me

    int WINAPI WinMain(...) { ... }

    Can anybody tell me what is WINAPI? Why is it declared after the type and before the function name?

    i have checked up Microsoft MSDN site and searched the forum here but to no positive results..

    hope brothers here can help me~ thanks!!



    DEar friend

    Pl send the full code so that i can give explanation for these

    M.Kathiresan
    Sub Divisional Engineer Telecom
    BSNL
    INDIA
    [email protected]

  8. #8
    Join Date
    Jul 2003
    Posts
    75

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    One option is to install "Visual Assist", the great software to help you do and understand coding better in visual C++ 6 as well as visual C++ .net

    Visual Assist shows you the macro definitions in a toolbar of its own in the same window along with many other benefits. You dont have to do right click + go to definition stuff.

    I will also recommend you to have a copy of "Programming Windows" by "Charles Petzold" on your desk when you are doing programming for windows in Win32 API. This great book will explain you many basic windows data types and many other good stuff. You can say it is a bible for windows programming.

  9. #9
    Join Date
    Dec 2001
    Location
    Chennai
    Posts
    101

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    If the code is successfull compiled, you can use F12 key to go to any functions, keywords definition.
    Tks
    Anupam

  10. #10
    Join Date
    Aug 2012
    Posts
    1

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Oh My Goodness, what kind of freaking MORONS are you people??? Dude, just Google it and you'll get your answer. In fact let me Google that for you http://lmgtfy.com/?q=What+is+WINAPI

    It constantly amazes me how incredibly STUPID some of these people are and most of them come from India. Try thinking a little bit. Are you so used to stealing test answers and faking resumes that you truly can't figure out something simple on your own?????

  11. #11
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Why on earth did you wake up an 8 year old thread with that post?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  12. #12
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Quote Originally Posted by S_M_A View Post
    Why on earth did you wake up an 8 year old thread with that post?
    I think he ran out of pills his first post and the only thing he does is calling names.

  13. #13
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: int WINAPI WinMain(...) ~ hey guys, can tell me what does the WINAPI mean?

    Quote Originally Posted by MonkeyCrackAss View Post
    ... some of these people are and most of them come from India.
    Well, at least we know where they come from.
    And you seem to come from nowhere...
    Victor Nijegorodov

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

Featured