COM Interop question in .NET 2.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vish

    COM Interop question in .NET 2.0

    Hi,

    I am trying to expose my .NET 2.0 class as a COM type using the following
    attributes for the attributes

    [ClassInterface( ClassInterfaceT ype.None)]
    [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

    I have the "Register for COM Interop" build property set to true. I also
    have two functions in the class to register and unregister the COM with the
    registry. But when i try to build it in VS.NET 2005, i get the following
    error "XXX.dll does not contain any types that can be registered for COM
    Interop" and "XXX.dll does not contain any types that can be Unregistered for
    COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
    any reasons why this is happeneing or what i am doing wrong?

    Thank You,
    Vish
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: COM Interop question in .NET 2.0

    Vish,

    Is it an error in the build process, or the registration process?


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
    news:1971A23E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...[color=blue]
    > Hi,
    >
    > I am trying to expose my .NET 2.0 class as a COM type using the following
    > attributes for the attributes
    >
    > [ClassInterface( ClassInterfaceT ype.None)]
    > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
    >
    > I have the "Register for COM Interop" build property set to true. I also
    > have two functions in the class to register and unregister the COM with
    > the
    > registry. But when i try to build it in VS.NET 2005, i get the following
    > error "XXX.dll does not contain any types that can be registered for COM
    > Interop" and "XXX.dll does not contain any types that can be Unregistered
    > for
    > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
    > of
    > any reasons why this is happeneing or what i am doing wrong?
    >
    > Thank You,
    > Vish[/color]


    Comment

    • Jason Newell

      #3
      Re: COM Interop question in .NET 2.0

      Vish,

      Could it be that ComVisible is false by default now in 2.0? Try the
      following example and see if it works.

      [ClassInterface( ClassInterfaceT ype.None)]
      [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
      [ComVisible(true )]


      Jason Newell


      Vish wrote:[color=blue]
      > Hi,
      >
      > I am trying to expose my .NET 2.0 class as a COM type using the following
      > attributes for the attributes
      >
      > [ClassInterface( ClassInterfaceT ype.None)]
      > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
      >
      > I have the "Register for COM Interop" build property set to true. I also
      > have two functions in the class to register and unregister the COM with the
      > registry. But when i try to build it in VS.NET 2005, i get the following
      > error "XXX.dll does not contain any types that can be registered for COM
      > Interop" and "XXX.dll does not contain any types that can be Unregistered for
      > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
      > any reasons why this is happeneing or what i am doing wrong?
      >
      > Thank You,
      > Vish[/color]

      Comment

      • Willy Denoyette [MVP]

        #4
        Re: COM Interop question in .NET 2.0


        "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
        news:1971A23E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...[color=blue]
        > Hi,
        >
        > I am trying to expose my .NET 2.0 class as a COM type using the following
        > attributes for the attributes
        >
        > [ClassInterface( ClassInterfaceT ype.None)]
        > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
        >
        > I have the "Register for COM Interop" build property set to true. I also
        > have two functions in the class to register and unregister the COM with
        > the
        > registry. But when i try to build it in VS.NET 2005, i get the following
        > error "XXX.dll does not contain any types that can be registered for COM
        > Interop" and "XXX.dll does not contain any types that can be Unregistered
        > for
        > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
        > of
        > any reasons why this is happeneing or what i am doing wrong?
        >
        > Thank You,
        > Vish[/color]

        Don't know what exactly you do in the functions that register/unregister the
        class, mind to post your code?


        Willy.


        Comment

        • Vish

          #5
          Re: COM Interop question in .NET 2.0

          Hi Jason,

          Seems like that did the trick. i am able to build the class after setting
          the ComVisible attribute of the class to true. I appreciate your help in this
          matter.

          Thank You,
          Vish


          "Jason Newell" wrote:
          [color=blue]
          > Vish,
          >
          > Could it be that ComVisible is false by default now in 2.0? Try the
          > following example and see if it works.
          >
          > [ClassInterface( ClassInterfaceT ype.None)]
          > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
          > [ComVisible(true )]
          >
          >
          > Jason Newell
          >
          >
          > Vish wrote:[color=green]
          > > Hi,
          > >
          > > I am trying to expose my .NET 2.0 class as a COM type using the following
          > > attributes for the attributes
          > >
          > > [ClassInterface( ClassInterfaceT ype.None)]
          > > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
          > >
          > > I have the "Register for COM Interop" build property set to true. I also
          > > have two functions in the class to register and unregister the COM with the
          > > registry. But when i try to build it in VS.NET 2005, i get the following
          > > error "XXX.dll does not contain any types that can be registered for COM
          > > Interop" and "XXX.dll does not contain any types that can be Unregistered for
          > > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
          > > any reasons why this is happeneing or what i am doing wrong?
          > >
          > > Thank You,
          > > Vish[/color]
          >[/color]

          Comment

          • Vish

            #6
            Re: COM Interop question in .NET 2.0

            Hi Nicholas,

            The error occured while building. But i was able to solve the problem by
            setting the ComVisible attribute to true on the class according to Jason's
            reply. I think the ComVisible attribute is set to false by default where in
            it was true by default in 1.1.

            I appreciate your help in this matter.

            Thank You,
            Vish


            "Nicholas Paldino [.NET/C# MVP]" wrote:
            [color=blue]
            > Vish,
            >
            > Is it an error in the build process, or the registration process?
            >
            >
            > --
            > - Nicholas Paldino [.NET/C# MVP]
            > - mvp@spam.guard. caspershouse.co m
            >
            > "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
            > news:1971A23E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...[color=green]
            > > Hi,
            > >
            > > I am trying to expose my .NET 2.0 class as a COM type using the following
            > > attributes for the attributes
            > >
            > > [ClassInterface( ClassInterfaceT ype.None)]
            > > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
            > >
            > > I have the "Register for COM Interop" build property set to true. I also
            > > have two functions in the class to register and unregister the COM with
            > > the
            > > registry. But when i try to build it in VS.NET 2005, i get the following
            > > error "XXX.dll does not contain any types that can be registered for COM
            > > Interop" and "XXX.dll does not contain any types that can be Unregistered
            > > for
            > > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
            > > of
            > > any reasons why this is happeneing or what i am doing wrong?
            > >
            > > Thank You,
            > > Vish[/color]
            >
            >
            >[/color]

            Comment

            • Vish

              #7
              Re: COM Interop question in .NET 2.0

              Hi Willy,

              Jason's suggestion fixed my problem. Looks like the ComVisible property is
              false by default in .NET 2.0 where in it was true by default in 1.1. If you
              are still interested in looking at the code, let me know. I will post it. I
              appreciate you help with this issue.

              Thank You,
              Vish


              "Willy Denoyette [MVP]" wrote:
              [color=blue]
              >
              > "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
              > news:1971A23E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...[color=green]
              > > Hi,
              > >
              > > I am trying to expose my .NET 2.0 class as a COM type using the following
              > > attributes for the attributes
              > >
              > > [ClassInterface( ClassInterfaceT ype.None)]
              > > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
              > >
              > > I have the "Register for COM Interop" build property set to true. I also
              > > have two functions in the class to register and unregister the COM with
              > > the
              > > registry. But when i try to build it in VS.NET 2005, i get the following
              > > error "XXX.dll does not contain any types that can be registered for COM
              > > Interop" and "XXX.dll does not contain any types that can be Unregistered
              > > for
              > > COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
              > > of
              > > any reasons why this is happeneing or what i am doing wrong?
              > >
              > > Thank You,
              > > Vish[/color]
              >
              > Don't know what exactly you do in the functions that register/unregister the
              > class, mind to post your code?
              >
              >
              > Willy.
              >
              >
              >[/color]

              Comment

              • Willy Denoyette [MVP]

                #8
                Re: COM Interop question in .NET 2.0

                Can't be the reason as the default for ComVisible is still true.

                Willy.

                "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                news:031183D1-0F72-4AF0-96CF-4E283F129869@mi crosoft.com...[color=blue]
                > Hi Willy,
                >
                > Jason's suggestion fixed my problem. Looks like the ComVisible property is
                > false by default in .NET 2.0 where in it was true by default in 1.1. If
                > you
                > are still interested in looking at the code, let me know. I will post it.
                > I
                > appreciate you help with this issue.
                >
                > Thank You,
                > Vish
                >
                >
                > "Willy Denoyette [MVP]" wrote:
                >[color=green]
                >>
                >> "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                >> news:1971A23E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...[color=darkred]
                >> > Hi,
                >> >
                >> > I am trying to expose my .NET 2.0 class as a COM type using the
                >> > following
                >> > attributes for the attributes
                >> >
                >> > [ClassInterface( ClassInterfaceT ype.None)]
                >> > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
                >> >
                >> > I have the "Register for COM Interop" build property set to true. I
                >> > also
                >> > have two functions in the class to register and unregister the COM with
                >> > the
                >> > registry. But when i try to build it in VS.NET 2005, i get the
                >> > following
                >> > error "XXX.dll does not contain any types that can be registered for
                >> > COM
                >> > Interop" and "XXX.dll does not contain any types that can be
                >> > Unregistered
                >> > for
                >> > COM Interop". The same code works perfectly in VS.NET 2003. Anybody
                >> > know
                >> > of
                >> > any reasons why this is happeneing or what i am doing wrong?
                >> >
                >> > Thank You,
                >> > Vish[/color]
                >>
                >> Don't know what exactly you do in the functions that register/unregister
                >> the
                >> class, mind to post your code?
                >>
                >>
                >> Willy.
                >>
                >>
                >>[/color][/color]


                Comment

                • Jason Newell

                  #9
                  Re: COM Interop question in .NET 2.0

                  Vish,

                  Willy is correct per documentation:
                  http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx.

                  I'd be interested to know why explicitly settings [ComVisible(true )]
                  fixed the problem. Unfortunately, I don't have 2.0 or I'd test it myself.

                  Jason Newell


                  Willy Denoyette [MVP] wrote:[color=blue]
                  > Can't be the reason as the default for ComVisible is still true.
                  >
                  > Willy.
                  >
                  > "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                  > news:031183D1-0F72-4AF0-96CF-4E283F129869@mi crosoft.com...
                  >[color=green]
                  >>Hi Willy,
                  >>
                  >>Jason's suggestion fixed my problem. Looks like the ComVisible property is
                  >>false by default in .NET 2.0 where in it was true by default in 1.1. If
                  >>you
                  >>are still interested in looking at the code, let me know. I will post it.
                  >>I
                  >>appreciate you help with this issue.
                  >>
                  >>Thank You,
                  >>Vish
                  >>
                  >>
                  >>"Willy Denoyette [MVP]" wrote:
                  >>
                  >>[color=darkred]
                  >>>"Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                  >>>news:1971A23 E-7E8D-4605-A5B3-FDCF6BF4F6C1@mi crosoft.com...
                  >>>
                  >>>>Hi,
                  >>>>
                  >>>>I am trying to expose my .NET 2.0 class as a COM type using the
                  >>>>following
                  >>>>attribute s for the attributes
                  >>>>
                  >>>>[ClassInterface( ClassInterfaceT ype.None)]
                  >>>>[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
                  >>>>
                  >>>>I have the "Register for COM Interop" build property set to true. I
                  >>>>also
                  >>>>have two functions in the class to register and unregister the COM with
                  >>>>the
                  >>>>registry. But when i try to build it in VS.NET 2005, i get the
                  >>>>following
                  >>>>error "XXX.dll does not contain any types that can be registered for
                  >>>>COM
                  >>>>Interop" and "XXX.dll does not contain any types that can be
                  >>>>Unregistere d
                  >>>>for
                  >>>>COM Interop". The same code works perfectly in VS.NET 2003. Anybody
                  >>>>know
                  >>>>of
                  >>>>any reasons why this is happeneing or what i am doing wrong?
                  >>>>
                  >>>>Thank You,
                  >>>>Vish
                  >>>
                  >>>Don't know what exactly you do in the functions that register/unregister
                  >>>the
                  >>>class, mind to post your code?
                  >>>
                  >>>
                  >>>Willy.
                  >>>
                  >>>
                  >>>[/color][/color]
                  >
                  >
                  >[/color]

                  Comment

                  • Willy Denoyette [MVP]

                    #10
                    Re: COM Interop question in .NET 2.0


                    "Jason Newell" <nospam@nospam. com> wrote in message
                    news:OeqVDFK5FH A.3588@TK2MSFTN GP15.phx.gbl...[color=blue]
                    > Vish,
                    >
                    > Willy is correct per documentation:
                    > http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx.
                    >
                    > I'd be interested to know why explicitly settings [ComVisible(true )] fixed
                    > the problem. Unfortunately, I don't have 2.0 or I'd test it myself.
                    >
                    > Jason Newell
                    >
                    >[/color]

                    And not only per documentation ;-), it was the default since version 1.0 and
                    did not change in v2.0 (that would be a breaking change).
                    I tested this with v2.0 and I can confirm 'true' is still the default.

                    Willy.


                    Comment

                    • Jason Newell

                      #11
                      Re: COM Interop question in .NET 2.0

                      Yeah I know it's always been default because it's bitten me in the
                      rear-end a few times ;-). I honestly didn't think that they would have
                      made a breaking change like that. So the question that still remains,
                      did setting [ComVisible(true )] really solve the problem or was it
                      something else?


                      Jason Newell


                      Willy Denoyette [MVP] wrote:[color=blue]
                      > "Jason Newell" <nospam@nospam. com> wrote in message
                      > news:OeqVDFK5FH A.3588@TK2MSFTN GP15.phx.gbl...
                      >[color=green]
                      >>Vish,
                      >>
                      >>Willy is correct per documentation:
                      >>http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx.
                      >>
                      >>I'd be interested to know why explicitly settings [ComVisible(true )] fixed
                      >>the problem. Unfortunately, I don't have 2.0 or I'd test it myself.
                      >>
                      >>Jason Newell
                      >>
                      >>[/color]
                      >
                      >
                      > And not only per documentation ;-), it was the default since version 1.0 and
                      > did not change in v2.0 (that would be a breaking change).
                      > I tested this with v2.0 and I can confirm 'true' is still the default.
                      >
                      > Willy.
                      >
                      >[/color]

                      Comment

                      • Willy Denoyette [MVP]

                        #12
                        Re: COM Interop question in .NET 2.0


                        "Jason Newell" <nospam@nospam. com> wrote in message
                        news:eCS0FVK5FH A.4036@TK2MSFTN GP11.phx.gbl...[color=blue]
                        > Yeah I know it's always been default because it's bitten me in the
                        > rear-end a few times ;-). I honestly didn't think that they would have
                        > made a breaking change like that. So the question that still remains, did
                        > setting [ComVisible(true )] really solve the problem or was it something
                        > else?
                        >
                        >
                        > Jason Newell
                        >
                        >[/color]

                        Pretty sure it was something else (my guess: missing public on the class).

                        Willy.




                        Comment

                        • Vish

                          #13
                          Re: COM Interop question in .NET 2.0

                          Hi,

                          Ok. I am not sure why but it did fix the issue. Obviously y'all know more on
                          this subject than i do. But i am posting my code below if y'all are still
                          interested.

                          [ClassInterface( ClassInterfaceT ype.None)]
                          [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
                          [ComVisible(true )]
                          public sealed class TestTool : BaseCommand
                          {
                          private IApplication m_app;

                          public override void OnCreate(object hook)
                          {
                          if (hook != null)
                          {
                          if (hook is IMxApplication)
                          {
                          m_app = (IApplication)h ook;
                          }
                          }
                          }

                          public override void OnClick()
                          {
                          IMxDocument mxDoc = (IMxDocument)m_ app.Document;
                          IActiveView activeView = mxDoc.ActiveVie w;
                          activeView.Exte nt = activeView.Full Extent;
                          activeView.Refr esh();
                          }

                          public TestTool()
                          {
                          base.m_category = "Vish's Test";
                          base.m_caption = "Full Extent C#";
                          base.m_message = "Zooms the display to its full extent";
                          base.m_toolTip = "Full Extent C#";
                          base.m_name = "Developer Samples_FullExt ent C#";

                          string[] res = GetType().Assem bly.GetManifest ResourceNames() ;
                          if (res.GetLength( 0) > 0)
                          {
                          base.m_bitmap = new
                          System.Drawing. Bitmap(GetType( ).Assembly.GetM anifestResource Stream(res[0]));
                          }
                          }

                          #region Component Category Registration

                          [ComRegisterFunc tion()]
                          [ComVisible(fals e)]
                          static void RegisterFunctio n(String regKey)
                          {
                          MxCommands.Regi ster(regKey);
                          }

                          [ComUnregisterFu nction()]
                          [ComVisible(fals e)]
                          static void UnregisterFunct ion(String regKey)
                          {
                          MxCommands.Unre gister(regKey);
                          }

                          #endregion
                          }
















                          "Willy Denoyette [MVP]" wrote:
                          [color=blue]
                          >
                          > "Jason Newell" <nospam@nospam. com> wrote in message
                          > news:eCS0FVK5FH A.4036@TK2MSFTN GP11.phx.gbl...[color=green]
                          > > Yeah I know it's always been default because it's bitten me in the
                          > > rear-end a few times ;-). I honestly didn't think that they would have
                          > > made a breaking change like that. So the question that still remains, did
                          > > setting [ComVisible(true )] really solve the problem or was it something
                          > > else?
                          > >
                          > >
                          > > Jason Newell
                          > >
                          > >[/color]
                          >
                          > Pretty sure it was something else (my guess: missing public on the class).
                          >
                          > Willy.
                          >
                          >
                          >
                          >
                          >[/color]

                          Comment

                          • Willy Denoyette [MVP]

                            #14
                            Re: COM Interop question in .NET 2.0

                            Sorry, but this is not a complete sample (missing BaseCommand), so there is
                            lttle I can do with it, but trust me [ComVisible(true )] IS the default.

                            I'm also not entirely clear on the purpose is of this class for a COM
                            client, true, this object creatable from COM clients, but none of it's
                            methods are callable.


                            Willy.

                            "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                            news:EBA6A147-26D1-4A45-8968-E5310CA2A179@mi crosoft.com...[color=blue]
                            > Hi,
                            >
                            > Ok. I am not sure why but it did fix the issue. Obviously y'all know more
                            > on
                            > this subject than i do. But i am posting my code below if y'all are still
                            > interested.
                            >
                            > [ClassInterface( ClassInterfaceT ype.None)]
                            > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
                            > [ComVisible(true )]
                            > public sealed class TestTool : BaseCommand
                            > {
                            > private IApplication m_app;
                            >
                            > public override void OnCreate(object hook)
                            > {
                            > if (hook != null)
                            > {
                            > if (hook is IMxApplication)
                            > {
                            > m_app = (IApplication)h ook;
                            > }
                            > }
                            > }
                            >
                            > public override void OnClick()
                            > {
                            > IMxDocument mxDoc = (IMxDocument)m_ app.Document;
                            > IActiveView activeView = mxDoc.ActiveVie w;
                            > activeView.Exte nt = activeView.Full Extent;
                            > activeView.Refr esh();
                            > }
                            >
                            > public TestTool()
                            > {
                            > base.m_category = "Vish's Test";
                            > base.m_caption = "Full Extent C#";
                            > base.m_message = "Zooms the display to its full extent";
                            > base.m_toolTip = "Full Extent C#";
                            > base.m_name = "Developer Samples_FullExt ent C#";
                            >
                            > string[] res = GetType().Assem bly.GetManifest ResourceNames() ;
                            > if (res.GetLength( 0) > 0)
                            > {
                            > base.m_bitmap = new
                            > System.Drawing. Bitmap(GetType( ).Assembly.GetM anifestResource Stream(res[0]));
                            > }
                            > }
                            >
                            > #region Component Category Registration
                            >
                            > [ComRegisterFunc tion()]
                            > [ComVisible(fals e)]
                            > static void RegisterFunctio n(String regKey)
                            > {
                            > MxCommands.Regi ster(regKey);
                            > }
                            >
                            > [ComUnregisterFu nction()]
                            > [ComVisible(fals e)]
                            > static void UnregisterFunct ion(String regKey)
                            > {
                            > MxCommands.Unre gister(regKey);
                            > }
                            >
                            > #endregion
                            > }
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            > "Willy Denoyette [MVP]" wrote:
                            >[color=green]
                            >>
                            >> "Jason Newell" <nospam@nospam. com> wrote in message
                            >> news:eCS0FVK5FH A.4036@TK2MSFTN GP11.phx.gbl...[color=darkred]
                            >> > Yeah I know it's always been default because it's bitten me in the
                            >> > rear-end a few times ;-). I honestly didn't think that they would have
                            >> > made a breaking change like that. So the question that still remains,
                            >> > did
                            >> > setting [ComVisible(true )] really solve the problem or was it something
                            >> > else?
                            >> >
                            >> >
                            >> > Jason Newell
                            >> >
                            >> >[/color]
                            >>
                            >> Pretty sure it was something else (my guess: missing public on the
                            >> class).
                            >>
                            >> Willy.
                            >>
                            >>
                            >>
                            >>
                            >>[/color][/color]


                            Comment

                            • Vish

                              #15
                              Re: COM Interop question in .NET 2.0

                              Hi Willy,

                              I wrote this class as an added tool for ESRI's ArcMap Software. The
                              BaseCommand class is part of their ArcObjects pacakage. So i will not be
                              provide you with that class. Anyway the the functions of the class below was
                              called and successfully executed from ArcMap which is completely built on
                              COM. Anyway that is not to say that you are write about what you are saying.
                              I just maybe it will help m eunderstand whats happeneing better. I class
                              below successfully created a new toolbar button and executed on click. Please
                              let me know what you think.

                              -Vish




                              "Willy Denoyette [MVP]" wrote:
                              [color=blue]
                              > Sorry, but this is not a complete sample (missing BaseCommand), so there is
                              > lttle I can do with it, but trust me [ComVisible(true )] IS the default.
                              >
                              > I'm also not entirely clear on the purpose is of this class for a COM
                              > client, true, this object creatable from COM clients, but none of it's
                              > methods are callable.
                              >
                              >
                              > Willy.
                              >
                              > "Vish" <Vish@discussio ns.microsoft.co m> wrote in message
                              > news:EBA6A147-26D1-4A45-8968-E5310CA2A179@mi crosoft.com...[color=green]
                              > > Hi,
                              > >
                              > > Ok. I am not sure why but it did fix the issue. Obviously y'all know more
                              > > on
                              > > this subject than i do. But i am posting my code below if y'all are still
                              > > interested.
                              > >
                              > > [ClassInterface( ClassInterfaceT ype.None)]
                              > > [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
                              > > [ComVisible(true )]
                              > > public sealed class TestTool : BaseCommand
                              > > {
                              > > private IApplication m_app;
                              > >
                              > > public override void OnCreate(object hook)
                              > > {
                              > > if (hook != null)
                              > > {
                              > > if (hook is IMxApplication)
                              > > {
                              > > m_app = (IApplication)h ook;
                              > > }
                              > > }
                              > > }
                              > >
                              > > public override void OnClick()
                              > > {
                              > > IMxDocument mxDoc = (IMxDocument)m_ app.Document;
                              > > IActiveView activeView = mxDoc.ActiveVie w;
                              > > activeView.Exte nt = activeView.Full Extent;
                              > > activeView.Refr esh();
                              > > }
                              > >
                              > > public TestTool()
                              > > {
                              > > base.m_category = "Vish's Test";
                              > > base.m_caption = "Full Extent C#";
                              > > base.m_message = "Zooms the display to its full extent";
                              > > base.m_toolTip = "Full Extent C#";
                              > > base.m_name = "Developer Samples_FullExt ent C#";
                              > >
                              > > string[] res = GetType().Assem bly.GetManifest ResourceNames() ;
                              > > if (res.GetLength( 0) > 0)
                              > > {
                              > > base.m_bitmap = new
                              > > System.Drawing. Bitmap(GetType( ).Assembly.GetM anifestResource Stream(res[0]));
                              > > }
                              > > }
                              > >
                              > > #region Component Category Registration
                              > >
                              > > [ComRegisterFunc tion()]
                              > > [ComVisible(fals e)]
                              > > static void RegisterFunctio n(String regKey)
                              > > {
                              > > MxCommands.Regi ster(regKey);
                              > > }
                              > >
                              > > [ComUnregisterFu nction()]
                              > > [ComVisible(fals e)]
                              > > static void UnregisterFunct ion(String regKey)
                              > > {
                              > > MxCommands.Unre gister(regKey);
                              > > }
                              > >
                              > > #endregion
                              > > }
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > >
                              > > "Willy Denoyette [MVP]" wrote:
                              > >[color=darkred]
                              > >>
                              > >> "Jason Newell" <nospam@nospam. com> wrote in message
                              > >> news:eCS0FVK5FH A.4036@TK2MSFTN GP11.phx.gbl...
                              > >> > Yeah I know it's always been default because it's bitten me in the
                              > >> > rear-end a few times ;-). I honestly didn't think that they would have
                              > >> > made a breaking change like that. So the question that still remains,
                              > >> > did
                              > >> > setting [ComVisible(true )] really solve the problem or was it something
                              > >> > else?
                              > >> >
                              > >> >
                              > >> > Jason Newell
                              > >> >
                              > >> >
                              > >>
                              > >> Pretty sure it was something else (my guess: missing public on the
                              > >> class).
                              > >>
                              > >> Willy.
                              > >>
                              > >>
                              > >>
                              > >>
                              > >>[/color][/color]
                              >
                              >
                              >[/color]

                              Comment

                              Working...