com/atl attributes broken

It seems most of the ATL/COM attributes from 2003 -> 2005 have been broken. Im using the RTM. I just compiled a COM/ATL project which works fine in 2k3 but in 2k5 i get lots of errors with attributes. A classic is:

[
uuid("xxx-blah-xxx")
]
class myForwardDeclaredClass;

That no longer works. I find I have to do:

class __declspec(uuid("xxx-blah-xxx")) myForwardDeclaredClass;

There is no documentation or acknowledgement of this problem anywhere. I wonder if anyone at MS actually tried compiling any COM/ATL projects in 2k5 before it shipped

Quite simply, unless breaking changes are documented then a project in 2k3 should compile in 2k5. I have yet to find any such documentation.


Answer this question

com/atl attributes broken

  • Michael Mac

    Please post a small sample exhibiting the problem and I will be more than happy to forward it to the reponsible folks.

    Thanks,
      Ayman Shoukry
      VC++ team

  • Waleed Seada

    I cannot agree. Just wrote a sample code:

    [ uuid("...") ]
    class CFoo {};

    ...
    const GUID &myGuid = __uuidof(CFoo);

    works correct!
    Just checked with .NET 2005 Beta 2!

  • Denton

    You can see my email address in my profile.

  • Berni P.

    Was this ever resolved

    Dan


  • DaveC#

    Unfortunately there is nothing covered in the breaking changes that affects the problem I (and many others - see microsoft.public.vc.atl) are suffering from.

    As for the code, I will have to come back later with a sample that shows the problem. The test the 2nd poster did was not quite what I meant - you also need to fully delclare the attributed class elsewhere in the project. You get errors C3121 + C3163.

  • Michel Jongbloed

    Please note a bug is now lodged for this issue on Connect:

    http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=143956


  • bazinou

    Not to my knowledge. I never got round to lodging it into the MS feedback site either, sorry.
  • jayww

    Seams to be a bug.

    It works if the class is defined completely and not a forward declaration is used!

    Try to file a bug at
    http://lab.msdn.microsoft.com/productfeedback

    If you want I can do it for you!

  • Dogbrain

    Email sent. Please confirm receipt.
  • amselem

    As Martin indicated, that should work in VC2005. However, there were still some changes in the attributes parts which are documented at http://msdn2.microsoft.com/en-us/library/ms177253.aspx.

    Take a look at such link since it could be a related issue.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Douwe

    I have created two identical projects - one that compiles in 2k3 and one that fails in 2k5. Please can you give me an email address so I can send these samples projects as attachments.


  • HemaR

    Yes I received it, but sorry I am currently not at my workstation with my 2005 installation. You get an answer!

  • com/atl attributes broken