Search the web
Sign In
New User? Sign Up
vsnetaddin · Visual Studio.NET Add-ins
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 3848 - 3877 of 3878   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#3877 From: "Jason Williams" <yahoo@...>
Date: Thu Apr 9, 2009 12:04 pm
Subject: Free plugin for download
zotwilliams
Offline Offline
Send Email Send Email
 
Hi guys,
Very quiet on ths group these days, but hopefully some people are still
listening... :-)

I've just released a plugin for VS 2005/2008 that you may find handy.

It includes several clipboard and outlining helpers, but the primary util is a
DocXml/Doxygen comment auto-generator for C/C++/C#/Java. This scans the code
element (method, class, struct, enum, etc) under the cursor and generates a
document comment, automaticallly deriving useful comment text from the names and
types used. If a comment already exists, it will update it to reflect any
changes to the code element (new parameters, etc). If base-class or override
documentation is available, it will be used to help populate the doc comment.
The format and auto-commenting rules used are all easily configurable via a
simple XML file.

Unlike similar add-ins, AtomineerUtils parses the code directly (rather than
relying on intellisense) so it works for non-compilable (incomplete) code, code
in comment blocks, etc.

Full details and a free download can be found here:
   http://www.atomineer.com/AtomineerUtils.html

Cheers,
Jason

#3876 From: "parasuraman.ramakrishnan" <aloker@...>
Date: Thu Oct 16, 2008 7:53 pm
Subject: Regarding Addin
parasuraman....
Offline Offline
Send Email Send Email
 
Hi,

I want to make an addin which reads an XML code in the center Screen.
When the addin is clicked it should call an Validator Engine which
checks the XML code for errors.

This is my Execute statment:
     Public Sub Exec(ByVal commandName As String, ByVal executeOption
As vsCommandExecOption, ByRef varIn As Object, ByRef varOut As Object,
ByRef handled As Boolean) Implements IDTCommandTarget.Exec
         handled = False
         If executeOption =
vsCommandExecOption.vsCommandExecOptionDoDefault Then
             If commandName = "MyAddin1.Connect.MyAddin1" Then

                 Dim a As New Class1
                 a.tests()


                 handled = True
                 Exit Sub
             End If
         End If
     End Sub


And the Class1 has a function called tests(). The class code is:

Imports EnvDTE
Imports EnvDTE80
Imports System.IO
Imports Extensibility
Imports System.Xml


Public Class Class1
     Dim applicationObject As DTE2
     Dim mydoc As XmlDocument





     Public Sub tests()

         'cmmd = applicationObject.Commands.Item("File.Open")

         'i = cmmd.ID
         'guid = cmmd.Guid
         'name = cmmd.Name

         Dim e As Int16 = 2

         Dim fs As New FileStream("C:\Validation.xml", FileMode.Open,
FileAccess.Read)
         Dim d As New StreamReader(fs)
         d.BaseStream.Seek(0, SeekOrigin.Begin)
         While d.Peek() > -1
             MsgBox(d.ReadLine)
         End While

     End Sub


End Class


When I try to do the following

mydoc.Load("/abc.xml")
dim node as XMLNode

node= myDoc.DocumentElement

MsgBox(node.ToString)

It doesnt work... But when I use the StreamReader it works perfctly.
Can I Load an XML file using the Load method?

Please Advice..

Thanks

#3875 From: "morten795" <morten@...>
Date: Thu Jul 24, 2008 5:08 pm
Subject: Programatically adding a VCProject to a Solution2 - how?
morten795
Offline Offline
Send Email Send Email
 
Hi,

I am writing a Visual Studio plugin and have created a new solution
programmatically (C#):

// Assuming applicationObject is a valid DTE2 instance.
Solution2 solution = (Solution2)_applicationObject.Solution;
solution.Close(true);
solution.Create(p.StartInfo.WorkingDirectory, "testSln");

Then I create a new VCProject programmatically:

VCProjectEngine projectEngine = new VCProjectEngineObject();
VCProject project = projectEngine.CreateProject("testProject");
project.AddPlatform("Win32");
project.AddConfiguration("TestConf");
VCConfiguration configuration = (VCConfiguration)
project.Configurations).Item("TestConf");
configuration.ConfigurationType = ConfigurationTypes.typeUnknown;

So far so good. I've looked around for a way to add the VCProject to
the solution but haven't found anything. I have tried doing the following:

project.ProjectFile = "C:\\testProj.vcproj";
project.Save();
solution.AddFromFile(project.ProjectFile, false);

But AddFromFile throws an exception: "Error HRESULT E_FAIL has been
returned from a call to a COM component.".

I am hoping somebody on this list has a solution or is able to point
me to some other forum/mailinglist, where it would make sense to ask.

Best Regards,
Morten Nielsen

#3874 From: "greeneyes_2399" <greeneyes_2399@...>
Date: Fri Jul 18, 2008 3:42 pm
Subject: How to add file types to File Open/Save dialogs
greeneyes_2399
Offline Offline
Send Email Send Email
 
I want to be able to display my file types in the common file dialogs
in my Visual Studio 2005/2008 C++ addin.  What is the best way to
achieve this?
Cheryl

#3873 From: "tom_mue" <TOM_MUE@...>
Date: Wed Jul 9, 2008 7:36 pm
Subject: vsCommandControlTypeMRUButton
tom_mue
Offline Offline
Send Email Send Email
 
hi @all,

is it possible to create a command from
CommandControlType "vsCommandControlTypeMRUButton"? The last
information that I found in the internet ist a post from carlos on
microsoft connect from 2005.

many thanks for any help
TOM

#3872 From: "noha_assem2030" <noha_assem2030@...>
Date: Sun Jun 22, 2008 12:40 pm
Subject: Re: System.Runtime.InteropServices.COMException - Unspecified error
noha_assem2030
Offline Offline
Send Email Send Email
 
--- In vsnetaddin@yahoogroups.com, "noha_assem2030" <noha_assem2030@...>
wrote:
>
> i've an add-in to document classes in XML style, i'm trying to
determine
> the type of a CodeElement as follows:
>
>   Dim fcmFileCodeModel As FileCodeModel =
> DTE.ActiveDocument.ProjectItem.FileCodeModel
>
> Dim editPoint As EditPoint =
> DTE.ActiveDocument.Selection.TopPoint.CreateEditPoint()
>
> Dim ceElement as CodeElement =
> editPoint.CodeElement(vsCMElement.vsCMElementProperty)
>
> on the previous line i get the error:
> editPoint.CodeElement(EnvDTE.vsCMElement.vsCMElementProperty)
> Overload resolution failed because no accessible 'CodeElement' is most
> specific for these arguments:
>      'Public Overridable ReadOnly Property CodeElement(Scope As
> EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.
>      'Public Overridable ReadOnly Property CodeElement(Scope As
> EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.
>
> and when i try to use the FileCodeModel object:
>
> ceElement =
>
fcmFileCodeModel.CodeElementFromPoint(DTE.ActiveDocument.Selection.Activ\
\
> ePoint, vsCMElement.vsCMElementProperty)
>
> i get the following exception:
> fcmFileCodeModel.CodeElementFromPoint(editPoint,
> vsCMElement.vsCMElementProperty)    Run-time exception thrown :
> System.Runtime.InteropServices.COMException - Unspecified error
>
> And strange enough it works fine with Classes & Functions , What is
> missing??

I've found the solution in the following link:
HowTo: Get a code element at the cursor from a visual studio.net macro
or add-in <http://www.mztools.com/articles/2006/MZ2006009.aspx>



[Non-text portions of this message have been removed]

#3871 From: "noha_assem2030" <noha_assem2030@...>
Date: Sun Jun 22, 2008 9:31 am
Subject: System.Runtime.InteropServices.COMException - Unspecified error
noha_assem2030
Offline Offline
Send Email Send Email
 
i've an add-in to document classes in XML style, i'm trying to determine
the type of a CodeElement as follows:

   Dim fcmFileCodeModel As FileCodeModel =
DTE.ActiveDocument.ProjectItem.FileCodeModel

Dim editPoint As EditPoint =
DTE.ActiveDocument.Selection.TopPoint.CreateEditPoint()

Dim ceElement as CodeElement =
editPoint.CodeElement(vsCMElement.vsCMElementProperty)

on the previous line i get the error:
editPoint.CodeElement(EnvDTE.vsCMElement.vsCMElementProperty)
Overload resolution failed because no accessible 'CodeElement' is most
specific for these arguments:
      'Public Overridable ReadOnly Property CodeElement(Scope As
EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.
      'Public Overridable ReadOnly Property CodeElement(Scope As
EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.

and when i try to use the FileCodeModel object:

ceElement =
fcmFileCodeModel.CodeElementFromPoint(DTE.ActiveDocument.Selection.Activ\
ePoint, vsCMElement.vsCMElementProperty)

i get the following exception:
fcmFileCodeModel.CodeElementFromPoint(editPoint,
vsCMElement.vsCMElementProperty)    Run-time exception thrown :
System.Runtime.InteropServices.COMException - Unspecified error

And strange enough it works fine with Classes & Functions , What is
missing??





[Non-text portions of this message have been removed]

#3870 From: Duncan Lees <duncan@...>
Date: Fri Jun 13, 2008 1:54 pm
Subject: Re: Run Post Build Command for a VCConfiguration
blu3_d0g
Offline Offline
Send Email Send Email
 
Enumerate the Tools collection on your object, and look for the tool
that supports the VCPostBuildEventTool interface.

-Duncan

vsnetaddin@yahoogroups.com wrote:
> 1. Run Post Build Command for a VCConfiguration
>     Posted by: "hauptmannp" hauptmannp@... hauptmannp
>     Date: Thu Jun 12, 2008 7:01 am ((PDT))
>
> I want to run the post build command (as configured in the project
> settings) for a specific configuration in a C++ project.
>
> I do have the VCConfiguration object, but I don't know how to go from
> here.
>
> Any suggestions?

#3869 From: "hauptmannp" <hauptmannp@...>
Date: Thu Jun 12, 2008 11:35 am
Subject: Run Post Build Command for a VCConfiguration
hauptmannp
Offline Offline
Send Email Send Email
 
I want to run the post build command (as configured in the project
settings) for a specific configuration in a C++ project.

I do have the VCConfiguration object, but I don't know how to go from
here.

Any suggestions?

#3868 From: "noha_assem2030" <noha_assem2030@...>
Date: Sun Jun 8, 2008 12:16 pm
Subject: Display Tools menu item add-in
noha_assem2030
Offline Offline
Send Email Send Email
 
Greetings,

I've an add-in that loads fine but shown as 'dimmed' or 'disabled' in
Tools menu. Here is the OnConnect function implementation:

Try
             _applicationObject = CType(application, EnvDTE80.DTE2)
             _addInInstance = CType(addInInst, EnvDTE.AddIn)
             If connectMode = ext_ConnectMode.ext_cm_UISetup Then
                 Dim objAddIn As AddIn = CType(addInInst, AddIn)
                 Dim CommandObj As Command
                 Dim objCommandBar As CommandBar

                 ClearExistingCommands()
objCommandBar =
CType(_applicationObject.Commands.AddCommandBar("CommenterMacros",
vsCommandBarType.vsCommandBarTypeMenu,
_applicationObject.CommandBars.Item("Tools")),
Microsoft.VisualStudio.CommandBars.CommandBar)

                 CommandObj =
_applicationObject.Commands.AddNamedCommand(objAddIn,
"InsertSeeAlsoTag", "InsertSeeAlsoTag", "TODO: Enter your command
description", True, 59, Nothing, 1 + 2)
                 CommandObj.AddControl(objCommandBar)
End If
         Catch ex As Exception
             MsgBox(ex.StackTrace, MsgBoxStyle.Information, "Add-in Error")
         End Try

'***************************

Where the ClearExistingCommands function as follows:

Private Sub ClearExistingCommands()
         Try
             For Each cmd As CommandBarControl In
CType(_applicationObject.CommandBars.Item("Tools"), CommandBar).Controls
                 If cmd.Caption = "CommenterMacros" OrElse cmd.Caption
= "CommentMacros" Then
                     cmd.Delete()
                 End If
             Next
         Catch ex As Exception
             MsgBox(ex.Message, MsgBoxStyle.Information, "Add-in Error")
         End Try
     End Sub
'**********************************************
When i debug the code it fires an exception on the line:

CommandObj = _applicationObject.Commands.AddNamedCommand(objAddIn,
"InsertSeeAlsoTag", "InsertSeeAlsoTag", "TODO: Enter your command
description", True, 59, Nothing, 1 + 2)

"A Command with that name already exists.". Am i missing something??

#3867 From: "Kevin McFarlane" <kaa_mcfarlane@...>
Date: Thu Jun 5, 2008 9:51 am
Subject: Re: Script Outline Add-In for Visual Studio 2005
kaa_mcfarlane
Offline Offline
Send Email Send Email
 
I can't get this to work. It's registered as present and checked in
the Add-in Manager. But the Script Outline window does not appear.

When I started a new instance of Visual Studio a while ago I did spot
it appearing during start-up but it then disappeared afterwards. Any
ideas?

Kevin
--- In vsnetaddin@yahoogroups.com, "evgenypages" <ekleiman@...> wrote:
>
>
> I'd like to announce an Add-In that I just have written.
> It allows to see a script outline of javascript and vbscript code
> in form of a tree as it was done in Visual Studio 6.
> When I have begun to work in IDE of VS 2005 I was a bit disappointed
> because of luck of this feature. Yes, they add comboboxes at the top of
> any aspx-page but is not the same. More than this, in .js files there
> are no comboboxes. So I decided to write such add-in and it was my
> first add-in in VS 2005. It could be downloaded from here
> <http://www.geocities.com/evgenypages/ScriptOutline.zip>  .
>   Details and limitations of the program are found in readme.txt and in
> the source code.
> I am very grateful to Carlos Quintero that points me out how to catch
> events WindowActivated and DocumentOpened in add-ins. Any feedback will
> be appreciated
> Evgeny Kleiman
>
>
>
>
> [Non-text portions of this message have been removed]
>

#3866 From: Jeff B <jeffbee42@...>
Date: Wed May 21, 2008 12:30 am
Subject: CreateDocumentWindow example
jeffbee42
Online Now Online Now
Send Email Send Email
 
Hello,

I wish to create a custom document window in my VS2005 add-in.  It
looks like I need to create a window via CreateDocumentWindow.  I've
seen examples on creating a window via CreateToolWindow but nothing on
CreateDocumentWindow.  Are there any examples on how to use
CreateDocumentWindow?


Thanks,


Jeff

#3865 From: "Neeraj Agrawal" <agrawal_neeraj@...>
Date: Thu Apr 24, 2008 10:31 am
Subject: Implementing add-in with "Find and Replace all references" programatically
agrawal_neeraj
Offline Offline
Send Email Send Email
 
I am implementing the package implementation and I need to be able to
modify all the references of either a given class or method. Is there
any way I can do it programatically?

#3864 From: "korthmat" <matthew.korth@...>
Date: Tue Apr 22, 2008 4:53 pm
Subject: The value of Scope is *what* in my OnBuildBegin event handler?
korthmat
Online Now Online Now
Send Email Send Email
 
I'm responsible for an add-in that we use to allow our analysts (who
are actually accountants for the most part) to do a build, so the
programmers don't get constantly interrupted for rebuilds for
something the analysts can easily handle.

The add-in uses OnBuildBegin and OnBuildDone event handlers for
logging and error reporting.  The event handlers *are* being called.
A trace statement at the beginning of both event handlers fires, so I
get this on my computer:

_BuildEvents_OnBuildBegin(vsBuildScopeSolution, vsBuildActionClean)
_BuildEvents_OnBuildDone(vsBuildScopeSolution, vsBuildActionClean)
_BuildEvents_OnBuildBegin(vsBuildScopeSolution, vsBuildActionBuild)
_BuildEvents_OnBuildDone(vsBuildScopeSolution, vsBuildActionBuild)

...

This is *exactly* what I expect to see, and oddly enough, things work
just fine for me.  However, instead of those trace statements, the
rest of the group gets this:

_BuildEvents_OnBuildBegin(0, vsBuildActionClean)
_BuildEvents_OnBuildDone(0, vsBuildActionClean)
_BuildEvents_OnBuildBegin(0, vsBuildActionBuild)
_BuildEvents_OnBuildDone(0, vsBuildActionBuild)

...

Since 0 != vsBuildScopeSolution, the rest of the handler doesn't fire,
and our log is largely useless.  The build *does* happen, it just
doesn't report anything about itself.

Has anyone else run into this, and if so, is there a way around it?

#3863 From: "miri_avi" <revivoavi@...>
Date: Sun Mar 30, 2008 9:01 am
Subject: CodeElementFromPoint in VS C++
miri_avi
Offline Offline
Send Email Send Email
 
Hi All,

I encounterd a problem which i fail to find a solution. I am trying
to get the Class name from a TextPoint (the class name of the
function which the text point is located in) in VS C++.

This code works great in C#:
currentProjectItem.FileCodeModel.CodeElementFromPoint(textPoint,
vsCMElement.vsCMElementClass).Name

however, in Visual C++ -
currentProjectItem.FileCodeModel.CodeElementFromPoint(textPoint,
vsCMElement.vsCMElementClass) -- returns null

i am working with VS 2005.

Any suggestions?

Thanks in advance,
Avi Revivo
Nice Systems

#3862 From: "Phil Jollans" <phil@...>
Date: Sat Feb 23, 2008 5:02 pm
Subject: Re: release candidate of my addin
pjollans
Offline Offline
Send Email Send Email
 
I heartily agree with your praise for Carlos, but I havn't heard from him in
this group for a long time.

On his web site (http://www.mztools.com/resources_vsnet_addins.aspx) he states
that this group is now quite dead, and recommends the MSDN forum
(http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=57).

Phil


[Non-text portions of this message have been removed]

#3861 From: "Joshua" <abusement@...>
Date: Sat Feb 23, 2008 4:38 pm
Subject: release candidate of my addin
elektrofetish
Offline Offline
Send Email Send Email
 
To anyone who might be interested.



I've just released a release candidate of my new addin, .netSavant and
wanted to share with the group how much the various postings here have
helped me get this thing completed with some hair left on my head!



Carlos. if it wasn't for your website and constant responses to others
postings, honestly, most of us would probably have given up on addin
development long ago (at least I would have).  I can't begin to thank you
enough.



So, if you want to take a look, check out http://www.dotnetsavant.com
<http://www.dotnetsavant.com/>



You can download the release candidate that I'm hoping to fully release in
the next month or so.  If you have any constructive feedback I'd love to
hear from you!



Again, thanks a ton!



Joshua Gall

Blog:  http://hurtsmybrains.wordpress.com
<http://hurtsmybrains.wordpress.com/>

Email:  abusement@...







[Non-text portions of this message have been removed]

#3860 From: "iangreenhill" <iangreenhill@...>
Date: Mon Feb 18, 2008 3:34 pm
Subject: Re: Uninstall Problem with VS2003 addin - multiple users
iangreenhill
Offline Offline
Send Email Send Email
 
Hello

Thank you for the tip, that's solved the problem.

As we want the addin to install for all users as well as single users
  is to add a NOT AdminUser condition to the key creation in CU and
only write to LM when AdminUser is true.

Ian

--- In vsnetaddin@yahoogroups.com, Duncan Lees <duncan@...> wrote:
>
> Our addin only adds the LM key, and works fine AFAIK. Are you sure you
> need to specify the CU key as well?
>
> -Duncan
>
> vsnetaddin@yahoogroups.com wrote:
> > Hello
> >
> > I create a stand MSI file from a Deployment project associated to my
> > addin. The installs for all users - the MSI file is invoked via
> > msiexec with ALLUSERS=1.
> >
> > The registry keyes defined are:
> >
> > HKLM\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect
> > HKCU\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect
> >
> > This all works well. I can install the software as administrator and
> > the login as another user. When they start Visual studio the setup for
> > the addin is invoked and again all works well.
> >
> > I now uninstall the addin as administrator (msiexec /X add.msi
> > ALLUSERS=1). This works well for the administrator - when Visual
> > Studio is restarted the addin is gone and no error messages are
> > displayed. The registry keys added above are removed and the addin
> > files have been  removed. However when I start visual studio as the
> > other user I get a Class Not Registered error 80040154. The addin
> > registry key for the Current User was still present. Does anyone know
> > if it is possibility to prevent this error message being displayed?
> >
> > Thanks
> >
> > Ian
> >
> >
> >
> >
> > Messages in this topic (1)
> >
________________________________________________________________________
> >
________________________________________________________________________
> >
> > Replies go to the entire list.  Visit
http://groups.yahoo.com/group/vsnetaddin to unsubscribe, search
message archives, or change delivery options.
> >
> >
> >
> >
------------------------------------------------------------------------
> > Yahoo! Groups Links
> >
> >
> >
> >
------------------------------------------------------------------------
> >
> >
>

#3859 From: Duncan Lees <duncan@...>
Date: Mon Feb 18, 2008 10:47 am
Subject: Re: Uninstall Problem with VS2003 addin - multiple users
blu3_d0g
Offline Offline
Send Email Send Email
 
Our addin only adds the LM key, and works fine AFAIK. Are you sure you
need to specify the CU key as well?

-Duncan

vsnetaddin@yahoogroups.com wrote:
> Hello
>
> I create a stand MSI file from a Deployment project associated to my
> addin. The installs for all users - the MSI file is invoked via
> msiexec with ALLUSERS=1.
>
> The registry keyes defined are:
>
> HKLM\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect
> HKCU\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect
>
> This all works well. I can install the software as administrator and
> the login as another user. When they start Visual studio the setup for
> the addin is invoked and again all works well.
>
> I now uninstall the addin as administrator (msiexec /X add.msi
> ALLUSERS=1). This works well for the administrator - when Visual
> Studio is restarted the addin is gone and no error messages are
> displayed. The registry keys added above are removed and the addin
> files have been  removed. However when I start visual studio as the
> other user I get a Class Not Registered error 80040154. The addin
> registry key for the Current User was still present. Does anyone know
> if it is possibility to prevent this error message being displayed?
>
> Thanks
>
> Ian
>
>
>
>
> Messages in this topic (1)
> ________________________________________________________________________
> ________________________________________________________________________
>
> Replies go to the entire list.  Visit http://groups.yahoo.com/group/vsnetaddin
to unsubscribe, search message archives, or change delivery options.
>
>
>
> ------------------------------------------------------------------------
> Yahoo! Groups Links
>
>
>
> ------------------------------------------------------------------------
>
>

#3858 From: "iangreenhill" <iangreenhill@...>
Date: Fri Feb 15, 2008 12:30 pm
Subject: Uninstall Problem with VS2003 addin - multiple users
iangreenhill
Offline Offline
Send Email Send Email
 
Hello

I create a stand MSI file from a Deployment project associated to my
addin. The installs for all users - the MSI file is invoked via
msiexec with ALLUSERS=1.

The registry keyes defined are:

HKLM\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect
HKCU\Software\Microsoft\VisualStudio\7.1\AddIns\VisualPlugin.Connect

This all works well. I can install the software as administrator and
the login as another user. When they start Visual studio the setup for
the addin is invoked and again all works well.

I now uninstall the addin as administrator (msiexec /X add.msi
ALLUSERS=1). This works well for the administrator - when Visual
Studio is restarted the addin is gone and no error messages are
displayed. The registry keys added above are removed and the addin
files have been  removed. However when I start visual studio as the
other user I get a Class Not Registered error 80040154. The addin
registry key for the Current User was still present. Does anyone know
if it is possibility to prevent this error message being displayed?

Thanks

Ian

#3857 From: "Rishikesh Parkhe" <rishiparkhe@...>
Date: Fri Feb 8, 2008 2:55 am
Subject: Re: Code generation and reverse engineering
rishiparkhe
Offline Offline
Send Email Send Email
 
Hi Joshua,
Thanks for your comments. I was also thinking about implementing my own
graph
for the code to be generated. And agree that CodeDOM is very powerful,
that's a
good enough point to stick with it.

cheers!



On 05/02/2008, Joshua <abusement@...> wrote:
>
>   In my opinion, CodeDOM, while very powerful is also very frustrating to
> work
> with. I also have created a code generator; however the code for the
> classes that I kick out is so complex that I found CodeDOM to be far too
> cumbersome and tedious. I mean, who wants to write 60 lines of CodeDOM
> code
> to generate 3 simple overloaded methods and add them to the graph.
> Additionally I wanted to structure the code that was kicked out in a way
> that CodeDOM just didn't seem flexible enough to accomplish.
>
> My approach has been to create my own code generation providers that
> inherit
> from the built in ones. Then, I create my own object graphs that represent
> the various elements that the code generator needs to create and pass them
> into the custom language specific custom code providers. In pseudo code:
>
> Public class PersonClassGraph{
> public string classname;
>
> Public string namespace;
>
> Public bool generateSomeMethod;
> }
>
> Public class CustomCSharpCodeProvider : CSharpCodeProvider{
> public void GenerateCodeForPerson(PersonClassGraph graph, TextWriter
> writer){
> // do whatever logic here to generate your code, probably using
> the text writer to just write out code manually.
> }
> }
>
> The object graphs that I make are FAR simpler than anything represented in
> CodeDOM, simply because the data that the graph will contain are going to
> be
> represented by the basic data types in .net. The drawback however is that
> now you have to create your own rendering code that normally would be
> handled by CodeDOM and the language specific code providers. Personally
> though I've found this to be far more manageable since you're basically
> just
> writing out language specific code to a text writer, and again you have
> full
> control over the code that's being generated.
>
> The CodeDOM folks will argue the benefits of that framework, and they are
> definitely valid, though if you have code that you want generated that
> code
> dom just doesn't support you will have to resort to writing your own
> provider system. I wanted my code to use the null coalescing operator.
> Unfortunately this operator is only supported by C#; vb.net requires a
> different programming structure to get the same functionality. Because of
> this, CodeDOM doesn't expose a method to generate this operator and the
> only
> way to get my code to generate the way that I wanted it to be was to roll
> my
> own system.
>
> I don't know that this answers your question, but it might give you
> another
> avenue to explore.
>
> Josh
>
> http://hurtsmybrains.wordpress.com <http://hurtsmybrains.wordpress.com/>
>
> _____
>
> From: vsnetaddin@yahoogroups.com <vsnetaddin%40yahoogroups.com> [mailto:
> vsnetaddin@yahoogroups.com <vsnetaddin%40yahoogroups.com>] On
> Behalf Of rishiparkhe
> Sent: Monday, February 04, 2008 11:09 PM
> To: vsnetaddin@yahoogroups.com <vsnetaddin%40yahoogroups.com>
> Subject: [vsnetaddin] Code generation and reverse engineering
>
> Hello all,
>
> I am writing a visual tool that would create custom classes, currently
> it uses CodeDOM.
> I am stuck a point where I need to parse the code for getting the type
> of the custom classes (if they are to be used in another custom class)
>
> For eg:
> class A {
> public int foo;
> }
>
> class B {
>
> public A instance_A;
> }
>
> For this I would have to build the solution and get the Type of A from
> the assembly ?
>
> or
>
> Should I use codeModel, but then I would have to generate code using
> FileCodeModel as well.
>
> Any thoughts ?
>
> Thanks.
>
> [Non-text portions of this message have been removed]
>
>
>



--
keep rendering your thoughts
http://freewebs.com/rishiparkhe


[Non-text portions of this message have been removed]

#3856 From: "Joshua" <abusement@...>
Date: Tue Feb 5, 2008 5:08 pm
Subject: RE: Code generation and reverse engineering
elektrofetish
Offline Offline
Send Email Send Email
 
In my opinion, CodeDOM, while very powerful is also very frustrating to work
with.  I also have created a code generator; however the code for the
classes that I kick out is so complex that I found CodeDOM to be far too
cumbersome and tedious.  I mean, who wants to write 60 lines of CodeDOM code
to generate 3 simple overloaded methods and add them to the graph.
Additionally I wanted to structure the code that was kicked out in a way
that CodeDOM just didn't seem flexible enough to accomplish.



My approach has been to create my own code generation providers that inherit
from the built in ones.  Then, I create my own object graphs that represent
the various elements that the code generator needs to create and pass them
into the custom language specific custom code providers.  In pseudo code:



Public class PersonClassGraph{
      public string classname;

      Public string namespace;

      Public bool generateSomeMethod;
}



Public class CustomCSharpCodeProvider : CSharpCodeProvider{
      public void GenerateCodeForPerson(PersonClassGraph graph, TextWriter
writer){
           // do whatever logic here to generate your code, probably using
the text writer to just write out code manually.
      }
}



The object graphs that I make are FAR simpler than anything represented in
CodeDOM, simply because the data that the graph will contain are going to be
represented by the basic data types in .net.  The drawback however is that
now you have to create your own rendering code that normally would be
handled by CodeDOM and the language specific code providers.  Personally
though I've found this to be far more manageable since you're basically just
writing out language specific code to a text writer, and again you have full
control over the code that's being generated.



The CodeDOM folks will argue the benefits of that framework, and they are
definitely valid, though if you have code that you want generated that code
dom just doesn't support you will have to resort to writing your own
provider system.  I wanted my code to use the null coalescing operator.
Unfortunately this operator is only supported by C#; vb.net requires a
different programming structure to get the same functionality.  Because of
this, CodeDOM doesn't expose a method to generate this operator and the only
way to get my code to generate the way that I wanted it to be was to roll my
own system.



I don't know that this answers your question, but it might give you another
avenue to explore.



Josh

http://hurtsmybrains.wordpress.com <http://hurtsmybrains.wordpress.com/>









   _____

From: vsnetaddin@yahoogroups.com [mailto:vsnetaddin@yahoogroups.com] On
Behalf Of rishiparkhe
Sent: Monday, February 04, 2008 11:09 PM
To: vsnetaddin@yahoogroups.com
Subject: [vsnetaddin] Code generation and reverse engineering



Hello all,

I am writing a visual tool that would create custom classes, currently
it uses CodeDOM.
I am stuck a point where I need to parse the code for getting the type
of the custom classes (if they are to be used in another custom class)

For eg:
class A {
public int foo;
}

class B {

public A instance_A;
}

For this I would have to build the solution and get the Type of A from
the assembly ?

or

Should I use codeModel, but then I would have to generate code using
FileCodeModel as well.

Any thoughts ?

Thanks.





[Non-text portions of this message have been removed]

#3855 From: "rishiparkhe" <rishiparkhe@...>
Date: Tue Feb 5, 2008 5:09 am
Subject: Code generation and reverse engineering
rishiparkhe
Offline Offline
Send Email Send Email
 
Hello all,

I am writing a visual tool that would create custom classes, currently
it uses CodeDOM.
I am stuck a point where I need to parse the code for getting the type
of the custom classes (if they are to be used in another custom class)

For eg:
class A {
  public int foo;
}

class B {

  public A instance_A;
}


For this I would have to build the solution and get the Type of A from
the assembly ?

or

Should I use codeModel, but then I would have to generate code using
FileCodeModel as well.

Any thoughts ?

Thanks.

#3854 From: "munderhillx" <mike.underhill@...>
Date: Tue Jan 15, 2008 5:38 pm
Subject: New Visual Studio 2005 AddIn Available
munderhillx
Offline Offline
Send Email Send Email
 
This Addin will sort the attributes of any well formed XML such as XAML
and other XML files.

Find it on my blog - http://blog.mikeunderhill.com

#3853 From: "ngo_udhs" <ngo_udhs@...>
Date: Tue Jan 15, 2008 2:54 pm
Subject: Re: Handling Events from ToolWindows in the Connect.cs Class
ngo_udhs
Offline Offline
Send Email Send Email
 
Phil,

I understand that event-handling should be done in the Form which it
was created.  However is it possible for the Exec method in the
Connect.cs class to listen for commands (i.e. button_Click) on a
User Control?  Should the example code below work?

public void Exec(string commandName...
{
...
if(commandName == "MyAddin.MyUserControl.btnMyButton_Click)
{
/* Code to close MyUserControl goes here*/
/* Code to open AnotherUserControl goes here*/
}
...
..

Thanks

--- In vsnetaddin@yahoogroups.com, "Phil Jollans" <phil@...> wrote:
>
> Hi Ngo,
>
> this isn't so much an Add-In problem, as a general .NET
programming question.
>
> If the button is on a UserControl, then the handler for the button
click event should go in that UserControl. Just double click on it
in the designer window and it will add the handler function.
>
> Phil
>
>   ----- Original Message -----
>   From: ngo_udhs
>   To: vsnetaddin@yahoogroups.com
>   Sent: Monday, January 14, 2008 7:28 PM
>   Subject: [vsnetaddin] Handling Events from ToolWindows in the
Connect.cs Class
>
>
>   I've created a add-in in VS.NET 2005 using C#.
>
>   The add-in loads a tool window OnConnection and it contains a
User
>   Control with input text fields and a "Login" button.
>
>   After the user clicks on this button, I want the User Control to
>   close and open another User Control after.
>
>   I was thinking I can have the Exec function in Connect.cs to
listen
>   for events such as a button_click however I had no such luck.
Would
>   this be the correct approach?
>
>   I've googled all over, but had no luck finding any advance
articles
>   on handling ToolWindow events.
>
>   Any help is greatly appreciated.
>
>   Thanks
>
>   (The code below will explain a little more of what I'm trying to
do.)
>
>   public void Exec(string commandName, vsCommandExecOption... )
>   {
>   handled=false;
>   if(executeOption ==
>   vsCommandExecOption.vsCommandExecOptionDoDefault)
>   {
>   if(commandName == "MyAddin.Connect.MyAddin")
>   {
>   handled = true;
>   return;
>   }
>   /* Clicking the "Login" button on the User Control form does
>   not execute this command. Why?*/
>
>   if(commandName == "MyAddin.LoginUserControl.btnLogin_Click)
>   {
>   /* Code to close LoginUserControl goes here*/
>   Debug.Print("=========Login button clicked!!=========");
>   /* Code to open another User Control goes here*/
>   ....
>   }
>   }
>   ...
>   ..
>   /* End of code snippet */
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

#3852 From: "Phil Jollans" <phil@...>
Date: Mon Jan 14, 2008 9:55 pm
Subject: Re: Handling Events from ToolWindows in the Connect.cs Class
pjollans
Offline Offline
Send Email Send Email
 
Hi Ngo,

this isn't so much an Add-In problem, as a general .NET programming question.

If the button is on a UserControl, then the handler for the button click event
should go in that UserControl. Just double click on it in the designer window
and it will add the handler function.

Phil

   ----- Original Message -----
   From: ngo_udhs
   To: vsnetaddin@yahoogroups.com
   Sent: Monday, January 14, 2008 7:28 PM
   Subject: [vsnetaddin] Handling Events from ToolWindows in the Connect.cs Class


   I've created a add-in in VS.NET 2005 using C#.

   The add-in loads a tool window OnConnection and it contains a User
   Control with input text fields and a "Login" button.

   After the user clicks on this button, I want the User Control to
   close and open another User Control after.

   I was thinking I can have the Exec function in Connect.cs to listen
   for events such as a button_click however I had no such luck. Would
   this be the correct approach?

   I've googled all over, but had no luck finding any advance articles
   on handling ToolWindow events.

   Any help is greatly appreciated.

   Thanks

   (The code below will explain a little more of what I'm trying to do.)

   public void Exec(string commandName, vsCommandExecOption... )
   {
   handled=false;
   if(executeOption ==
   vsCommandExecOption.vsCommandExecOptionDoDefault)
   {
   if(commandName == "MyAddin.Connect.MyAddin")
   {
   handled = true;
   return;
   }
   /* Clicking the "Login" button on the User Control form does
   not execute this command. Why?*/

   if(commandName == "MyAddin.LoginUserControl.btnLogin_Click)
   {
   /* Code to close LoginUserControl goes here*/
   Debug.Print("=========Login button clicked!!=========");
   /* Code to open another User Control goes here*/
   ....
   }
   }
   ...
   ..
   /* End of code snippet */





[Non-text portions of this message have been removed]

#3851 From: "ngo_udhs" <ngo_udhs@...>
Date: Mon Jan 14, 2008 6:28 pm
Subject: Handling Events from ToolWindows in the Connect.cs Class
ngo_udhs
Offline Offline
Send Email Send Email
 
I've created a add-in in VS.NET 2005 using C#.

The add-in loads a tool window OnConnection and it contains a User
Control with input text fields and a "Login" button.

After the user clicks on this button, I want the User Control to
close and open another User Control after.

I was thinking I can have the Exec function in Connect.cs to listen
for events such as a button_click however I had no such luck.  Would
this be the correct approach?

I've googled all over, but had no luck finding any advance articles
on handling ToolWindow events.

Any help is greatly appreciated.

Thanks

(The code below will explain a little more of what I'm trying to do.)

public void Exec(string commandName, vsCommandExecOption... )
{
       handled=false;
       if(executeOption ==
vsCommandExecOption.vsCommandExecOptionDoDefault)
             {
       if(commandName == "MyAddin.Connect.MyAddin")
       {
	 handled = true;
         return;
       }
       /* Clicking the "Login" button on the User Control form does
not execute this command.  Why?*/

       if(commandName == "MyAddin.LoginUserControl.btnLogin_Click)
       {
         /* Code to close LoginUserControl goes here*/
         Debug.Print("=========Login button clicked!!=========");
         /* Code to open another User Control goes here*/
         ....
       }
}
...
..
/* End of code snippet */

#3850 From: "greeneyes_2399" <greeneyes_2399@...>
Date: Thu Jan 3, 2008 12:52 am
Subject: Re: VCProject::get_Platforms
greeneyes_2399
Offline Offline
Send Email Send Email
 
Wouldn't you know it... as soon as I posted my message, a light bulb
went off in my head.  The problem is the cast between EnvDTE::Project
* and VCProjectEngineLibrary::VCProject *.  The correct way to do it is:

hr = prj->get_Object(&disp);
vcp = (VCProjectEngineLibrary::VCProject *) disp;


green
--- In vsnetaddin@yahoogroups.com, "greeneyes_2399"
<greeneyes_2399@...> wrote:
>
> The return value from VCProject::get_Platforms is incorrect in my C++
> VS 2005 addin.  Can someone tell me what I'm doing wrong?
>
> /////////////////////////////////////////////////////////////////
>  EnvDTE::_Solution *sln;
>  EnvDTE::Projects *prjs;
>  EnvDTE::Project *prj;
>  VCProjectEngineLibrary::VCProject *vcp;
>  hr = m_pDTE->get_Solution(&sln);
>  if ( SUCCEEDED(hr) )
>  {
> 	 hr = sln->get_Projects(&prjs);
> 	 if ( SUCCEEDED(hr) )
> 	 {
> 		 hr = prjs->Item(CComVariant(1), &prj);
> 		 IDispatch *disp;
> 		 if ( SUCCEEDED(hr) )
> 		 {
> 			 vcp = VCProjectEngineLibrary::VCProject *)prj;
> 			 hr = vcp->get_Platforms(&disp);
> VCProjectEngineLibrary::IVCCollection *plats
> =(VCProjectEngineLibrary::IVCCollection *)disp;
>
> //////////////////////////////////////////////////////////////////////
>
> If, in the debugger, I expand the value returned in disp, the vtable
> clearly is wrong.  In fact the memory pointed to by disp contains a
> Unicode string containing the current project name, e.g.
myproject.vcproj.
>
> Thanks
> green
>

#3849 From: "greeneyes_2399" <greeneyes_2399@...>
Date: Thu Jan 3, 2008 12:31 am
Subject: VCProject::get_Platforms
greeneyes_2399
Offline Offline
Send Email Send Email
 
The return value from VCProject::get_Platforms is incorrect in my C++
VS 2005 addin.  Can someone tell me what I'm doing wrong?

/////////////////////////////////////////////////////////////////
	 EnvDTE::_Solution *sln;
	 EnvDTE::Projects *prjs;
	 EnvDTE::Project *prj;
	 VCProjectEngineLibrary::VCProject *vcp;
	 hr = m_pDTE->get_Solution(&sln);
	 if ( SUCCEEDED(hr) )
	 {
		 hr = sln->get_Projects(&prjs);
		 if ( SUCCEEDED(hr) )
		 {
			 hr = prjs->Item(CComVariant(1), &prj);
			 IDispatch *disp;
			 if ( SUCCEEDED(hr) )
			 {
				 vcp = VCProjectEngineLibrary::VCProject *)prj;
				 hr = vcp->get_Platforms(&disp);
VCProjectEngineLibrary::IVCCollection *plats
=(VCProjectEngineLibrary::IVCCollection *)disp;

//////////////////////////////////////////////////////////////////////

If, in the debugger, I expand the value returned in disp, the vtable
clearly is wrong.  In fact the memory pointed to by disp contains a
Unicode string containing the current project name, e.g. myproject.vcproj.

Thanks
green

#3848 From: "Joshua" <abusement@...>
Date: Tue Jan 1, 2008 4:52 pm
Subject: RE: Licensing your Addin
elektrofetish
Offline Offline
Send Email Send Email
 
Interesting.  Since this group is for people who write .NET based addins for
vs.net you could also create your web service using, well, .NET ;)



But I digress.



Actually what I'm looking for is a commercial product to do this for me.
What you're describing here illustrates the basic principal behind software
activation, however the problem is not as simple to solve as you suggest.  A
successful licensing system (for me) must have the following features:



1. Be cryptographically secure
2. Support flexible software activation (with support for multiple
machine specific installations)
3. Provide a simple API for integration into my application
4. Be actively supported by the developer



The approach you describe is more susceptible to circumvention because it
relys on secrets (storing the value encoded in a registry field).  The few
systems that I've reviewed so far do use a web service for their software
activation; however they use a combination of signed and unsigned
certificates to provide a cryptographically secure methodology to validate a
software installation.  This methodology is far more secure than storing a
secret on a user's workstation.  It is important to understand as well that
no software protection scheme will protect your product from a determined
pirate; the goal is to simply provide a high enough barrier that the casual
hacker or curious developer isn't going to break the system that you've put
in place.



Personally, I'd rather buy a quality component to provide these features
than spend my hard to find time reinventing what is essentially a fairly
complex wheel.  Unfortunately there aren't very many people creating
licensing components for use in .NET applications.  I've found three or four
that look promising so we'll see how that all turns out.



Happy New Year :-)



Joshua







   _____

From: vsnetaddin@yahoogroups.com [mailto:vsnetaddin@yahoogroups.com] On
Behalf Of Shah Japan
Sent: Monday, December 31, 2007 11:31 PM
To: vsnetaddin@yahoogroups.com
Subject: Re: [vsnetaddin] Licensing your Addin



for example you can make a PHP web service using XML-RPC.
so user will enter the licence number if its in your DB then you can write
the registry
encoding data that this is a registered copy.

for xml-rpc web service you can use the cook computing xml-rpc DLL.

cook computing -> http://www.xml- <http://www.xml-rpc.net> rpc.net

like licencecheck.php?id=hdyldgdydyuddddff
u open this page
(with .net) and this page will display yes or no result
if it display yes, then it will increnet the no. of used licences
so a very simple program.

you required a hosting server or a Real IP where your PHP web-service is
deployed....

On Dec 31, 2007 4:01 PM, Phil Jollans <phil@jollans.
<mailto:phil%40jollans.com> com> wrote:

> Can you maybe explain a little bit more what you mean?
>
> Phil
>
>
> ----- Original Message -----
> From: Shah Japan
> To: vsnetaddin@yahoogro <mailto:vsnetaddin%40yahoogroups.com> ups.com
<vsnetaddin%40yahoogroups.com>
> Sent: Monday, December 31, 2007 10:12 AM
> Subject: Re: [vsnetaddin] Licensing your Addin
>
> You can use your own web services for licensing your addin.
>
> On Dec 30, 2007 8:16 PM, elektrofetish <abusement@imtraum.
<mailto:abusement%40imtraum.com> com<abusement%40imtraum.com>>
> wrote:
>
> > I'm looking to license my addin and am evaluating a few licensing
> > systems out there (DeployLX and Manco currently). I know there are
> > quite a few providers of licensing libraries that I can use and am
> > curious to see what others are using and what their experiences with
> > them are.
> >
> > So far I'm not terribly impressed with DeployLX (their site never seems
> > to want to render in IE7), which leaves me with the product from Manco.
> >
> > Any feedback would be greatly appreciated.
> >
> > Danke
> >
> > Joshua
> >
> >
> >
>
> --
> Regards,
> Japan Shah
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>

--
Regards,
Japan Shah

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]

Messages 3848 - 3877 of 3878   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help