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. COM
  4. add-ins in c++ using the DTE-object

add-ins in c++ using the DTE-object

Scheduled Pinned Locked Moved COM
questioncsharpc++tutorial
7 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.
  • S Offline
    S Offline
    schaereran gmx net
    wrote on last edited by
    #1

    hy, i have read a lot about this topic, but didnt found good answers. can anybody explain, how i can code the following VB-code in VC++ ? Sub DocumentsExample() MsgBox(DTE.Documents.Count) End Sub How can i get this DTE object? the compiler doesent recognises it. I would like to make an addin for VC++.NET in which i can manipulate the code. (textmanipulations) can anybody tell me, how i can do this? i dont know how to do things which i coud do in VB with activedocument.selection , etc.. thanx for any input!!!

    S A 2 Replies Last reply
    0
    • S schaereran gmx net

      hy, i have read a lot about this topic, but didnt found good answers. can anybody explain, how i can code the following VB-code in VC++ ? Sub DocumentsExample() MsgBox(DTE.Documents.Count) End Sub How can i get this DTE object? the compiler doesent recognises it. I would like to make an addin for VC++.NET in which i can manipulate the code. (textmanipulations) can anybody tell me, how i can do this? i dont know how to do things which i coud do in VB with activedocument.selection , etc.. thanx for any input!!!

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      When you create an add-in, you implement a set of interfaces, and some of them are passed a pointer to the current DTE instance you are looking for. So you don't really have to worry about it. More info here[^]. (DTE is short for IDTExtensibility2).

      S 1 Reply Last reply
      0
      • S Stephane Rodriguez

        When you create an add-in, you implement a set of interfaces, and some of them are passed a pointer to the current DTE instance you are looking for. So you don't really have to worry about it. More info here[^]. (DTE is short for IDTExtensibility2).

        S Offline
        S Offline
        schaereran gmx net
        wrote on last edited by
        #3

        unfortunately, i have read all written in your link before. im now working since 2 days at this problem, and i still have no idea how to solve my problem!!!! its making me crazy! cant you give me a link to a sample add-in (in c++) of an add-in, which simply does the following thing: clicking on the add-ins button makes, that the currently selected text in VC++.NET (or in Word, id dont care, code will be probably ca. the same)changes, or lets say will be deleted. so you can select some lines of text, click the add-in and the text will be deleted. how can i do this? it cant be this difficult, i think, but i cannot find any explanation of how to code an addin in c++, and no good sample-code thanx a lot for any help!

        S 1 Reply Last reply
        0
        • S schaereran gmx net

          unfortunately, i have read all written in your link before. im now working since 2 days at this problem, and i still have no idea how to solve my problem!!!! its making me crazy! cant you give me a link to a sample add-in (in c++) of an add-in, which simply does the following thing: clicking on the add-ins button makes, that the currently selected text in VC++.NET (or in Word, id dont care, code will be probably ca. the same)changes, or lets say will be deleted. so you can select some lines of text, click the add-in and the text will be deleted. how can i do this? it cant be this difficult, i think, but i cannot find any explanation of how to code an addin in c++, and no good sample-code thanx a lot for any help!

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          I believe you are confusing an add-in and a macro. Why don't just record a macro, and then examine the produced VBscript code to adapt it to more general needs?

          S 1 Reply Last reply
          0
          • S Stephane Rodriguez

            I believe you are confusing an add-in and a macro. Why don't just record a macro, and then examine the produced VBscript code to adapt it to more general needs?

            S Offline
            S Offline
            schaereran gmx net
            wrote on last edited by
            #5

            i dont confuse anything. i cant record a macro because 1. its not possible to records complicated things like those i want to do. 2. my boss told me he explicitly wants all code in c++. maby i should talk to the boss :-)

            S 1 Reply Last reply
            0
            • S schaereran gmx net

              i dont confuse anything. i cant record a macro because 1. its not possible to records complicated things like those i want to do. 2. my boss told me he explicitly wants all code in c++. maby i should talk to the boss :-)

              S Offline
              S Offline
              Stephane Rodriguez
              wrote on last edited by
              #6

              My advice then is to launch VS.NET, create a new project by choosing the project wizard called "extensibility" or something like this, then choose "shared add-in". Doing so, you've got a working skeleton created for you. And one of the methods has the IDEExtensibility2 interface we've been talking about. Using this interface, you can drill down to the current Document object, and get the selection. My suggestion is also to read this article[^] on MSDN.

              1 Reply Last reply
              0
              • S schaereran gmx net

                hy, i have read a lot about this topic, but didnt found good answers. can anybody explain, how i can code the following VB-code in VC++ ? Sub DocumentsExample() MsgBox(DTE.Documents.Count) End Sub How can i get this DTE object? the compiler doesent recognises it. I would like to make an addin for VC++.NET in which i can manipulate the code. (textmanipulations) can anybody tell me, how i can do this? i dont know how to do things which i coud do in VB with activedocument.selection , etc.. thanx for any input!!!

                A Offline
                A Offline
                Amit Dey
                wrote on last edited by
                #7

                have you checked out this and this?. While the first shows you how to implement IDTExtensibility2 in your addin, the next allows simple text addition to visualstudio via DTE.

                Hush,hush... thought I heard you call my name now. Kula Shaker. Amit Dey Latest articles at CP -
                PocketPC New menu Office addin

                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