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. ATL / WTL / STL
  4. DLL article question Resolved

DLL article question Resolved

Scheduled Pinned Locked Moved ATL / WTL / STL
questioncsharpc++visual-studiocom
3 Posts 2 Posters 5 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.
  • B Offline
    B Offline
    bkelly13
    wrote on last edited by
    #1

    Windows 10, Visual Studio 2012, C++, DLL I am working on understanding DLLs and reference this article: http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL?msg=5204076#xx5204076xx In there I find the phrase:

    typedef struct tagXYZHANDLE {} * XYZHANDLE;

    I downloaded the code and found only that one instance. I understand tyepdef and struct, but those empty braces throw me. Especially since I found only that one instance. Please point me to something that provides an explanation for what this is doing. Is there a particular name for that type of declaration?

    Thank you for your time

    Richard Andrew x64R 1 Reply Last reply
    0
    • B bkelly13

      Windows 10, Visual Studio 2012, C++, DLL I am working on understanding DLLs and reference this article: http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL?msg=5204076#xx5204076xx In there I find the phrase:

      typedef struct tagXYZHANDLE {} * XYZHANDLE;

      I downloaded the code and found only that one instance. I understand tyepdef and struct, but those empty braces throw me. Especially since I found only that one instance. Please point me to something that provides an explanation for what this is doing. Is there a particular name for that type of declaration?

      Thank you for your time

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      The braces are simply representing a structure with no members. And the *XYZHANDLE means that XYZHANDLE is a pointer to a tagXYZHANDLE structure. It's the fact that they put both braces on the same line that makes it look confusing. Consider:

      typedef struct tagXYZHANDLE
      {

      } *PXYZHANDLE;

      In fact, this is how the Windows type HANDLE is declared, as a pointer to an empty structure.

      The difficult we do right away... ...the impossible takes slightly longer.

      B 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        The braces are simply representing a structure with no members. And the *XYZHANDLE means that XYZHANDLE is a pointer to a tagXYZHANDLE structure. It's the fact that they put both braces on the same line that makes it look confusing. Consider:

        typedef struct tagXYZHANDLE
        {

        } *PXYZHANDLE;

        In fact, this is how the Windows type HANDLE is declared, as a pointer to an empty structure.

        The difficult we do right away... ...the impossible takes slightly longer.

        B Offline
        B Offline
        bkelly13
        wrote on last edited by
        #3

        OK, I see that now. And I see why he did that. I often have a difficult time seeing the obvious. Thank you for pointing that out and taking the time to reply.

        Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

        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