Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ syntax

C++ syntax

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsontutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ratul Thakur
    wrote on last edited by
    #1

    i am a C++ student and i was reading some source code and found this :

    void FGAPIENTRY glutMenuStateFunc( FGCBMenuState callback )
    {
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMenuStateFunc" );
    fgState.MenuStateCallback = callback;
    }

    in the code above , the return type is void and the function name is glutMenuStateFunc() .. what does FGAPIENTRY stand for and where dois it come from?? I've also seen some similar stuff wile reading a tutorial in win32 api

    CPalliniC L D 3 Replies Last reply
    0
    • R Ratul Thakur

      i am a C++ student and i was reading some source code and found this :

      void FGAPIENTRY glutMenuStateFunc( FGCBMenuState callback )
      {
      FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMenuStateFunc" );
      fgState.MenuStateCallback = callback;
      }

      in the code above , the return type is void and the function name is glutMenuStateFunc() .. what does FGAPIENTRY stand for and where dois it come from?? I've also seen some similar stuff wile reading a tutorial in win32 api

      CPalliniC Online
      CPalliniC Online
      CPallini
      wrote on last edited by
      #2

      FGAPIENTRY is defined somewhere in your header chain (you have to look there to find it) as an attribute of the function. On Windows code a similar define is often used to add dllexport/dllimport attribute to the same function, depending on the kind of build you are performing (the DLL itself or the application using the same DLL). See, for instance c++ - Macro for dllexport/dllimport switch - Stack Overflow[^].

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • R Ratul Thakur

        i am a C++ student and i was reading some source code and found this :

        void FGAPIENTRY glutMenuStateFunc( FGCBMenuState callback )
        {
        FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMenuStateFunc" );
        fgState.MenuStateCallback = callback;
        }

        in the code above , the return type is void and the function name is glutMenuStateFunc() .. what does FGAPIENTRY stand for and where dois it come from?? I've also seen some similar stuff wile reading a tutorial in win32 api

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        The FGAPIENTRY prefix is a macro that declares the calling convention for the generated code. It is similar to the WINAPI macro as described in Windows Data Types (Windows)[^].

        1 Reply Last reply
        0
        • R Ratul Thakur

          i am a C++ student and i was reading some source code and found this :

          void FGAPIENTRY glutMenuStateFunc( FGCBMenuState callback )
          {
          FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMenuStateFunc" );
          fgState.MenuStateCallback = callback;
          }

          in the code above , the return type is void and the function name is glutMenuStateFunc() .. what does FGAPIENTRY stand for and where dois it come from?? I've also seen some similar stuff wile reading a tutorial in win32 api

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Ratul Thakur wrote:

          ...what does FGAPIENTRY stand for...

          Look in your project's header files. It resolves to this.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups