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. attributed ATL, forward declare interface?

attributed ATL, forward declare interface?

Scheduled Pinned Locked Moved ATL / WTL / STL
c++databasehelpquestion
4 Posts 3 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.
  • J Offline
    J Offline
    Jared Allen
    wrote on last edited by
    #1

    I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };

    Jared Allen.

    M J J 3 Replies Last reply
    0
    • J Jared Allen

      I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };

      Jared Allen.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      This is going to sound snarky, but in all honesty you shouldn't use attributed ATL. It has never worked right. If at all possible, you should rewrite it in regular ATL.

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

      1 Reply Last reply
      0
      • J Jared Allen

        I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };

        Jared Allen.

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        I have to agree with Michael. Attributed COM/ATL is one of the most stupid idea ever conceived by the VC++ team... It's inefficient at compile time (Zzzzzz), and it causes general headaches in cases such as these. MIDL for the win!

        -- Raaaaaaaaaaaaaaaaaaaaa!

        1 Reply Last reply
        0
        • J Jared Allen

          I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };

          Jared Allen.

          J Offline
          J Offline
          Jared Allen
          wrote on last edited by
          #4

          hmmm, yeah i'm not enjoying using Attributed ATL. I only used it because I started a new project in VS 2003 and it must have been the default setting back then and so i thought "It must be better and the thing todo" so it has stuck with this particular project since then... I'm not looking forward to rewriting it though, i figured that forward declaration was such a common thing that there would be a well known solution.

          Jared Allen. www.chironexsoftware.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