ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

Latest post 01-12-2008 3:43 PM by Melody. 7 replies.
  • 12-06-2007 11:34 AM

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 245

    ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    This is an open invitation to submit quesitons or issues from ProxyGen v 1 to be addressed. 

    Please see our ProxyGen v 2 CTP Release Supplement for issues already addressed.

    If you are interested in getting access to the CTP, see the following post

     

     

  • 12-07-2007 5:10 AM In reply to

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    Great info, Melody, but pardon me if I'm not doing the Happy Joy Dance. ;-)

    I haven't read it in detail but it seems to me that very few major issues (from my point of view) have been fixed by Microsoft:

    - We still have to post process the proxy files to get static methods to work from the add-ins.
    - We still have to post process the proxy files to get constructors to work
    - We still have to post process the proxy files and merge them into one file, since ProxyGen doesn't seem to support multiple "input" DLLs (?)

    Some work has obviously been done to improve the handing of the descriptor files, which is a Good Thing, and the HostMap-files will be interesting to look through, but in all it doesn't really leave me with a "2.0" vibe.

    But I will look into the changes in more detail and I haven't begun looking at the CTP properly yet, so maybe I will come around to a more cheerful mood. ;)

    Thanks again!

  • 12-07-2007 8:58 AM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 318

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    >>merge them into one file

    I think that is no longer necessary

  • 12-07-2007 4:25 PM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 245

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    Henrik,

    That's ok I'm dancing enough for both of us  ;)

    Overall ProxyGen is able to handle more OM's with fewer problem- majorly better.
    The descriptor files are much easier to read.  The proxy file is easier to understand.  The host type maps are exposed.  Visual Basic is handled very nicely.  The supporting documentation is MUCH better.  *Happy Joy!*

    We are currently researching the static methods issue so there may be more improvements to come for that.

    As for the constructors issue, Naveen Yajaman (senior program manager for VSTA) made a good point in an interview on .Net Rocks (http://www.dotnetrocks.com/default.aspx?showNum=295) that objects are kept only on the host side so there is no "object management" tasks that add-ins need to do.  Allowing add-ins to use constructors deminishes this benefit.  They are kinda winning me over on this one, by default KeepItSimple and if that's not good enough fix it manually.

    ProxyGen does not accept input for multiple dll's and I agree with Gary- I don't think you need to mere the proxy files.  You will need to merge the host type map files though.

    I hope you enjoy digging around in the CTP release as much as I have and can find the "2.0 vibe" there.  I look forward to your review.

    ;)
    -Melody

  • 12-12-2007 2:25 PM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 245

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    Henrik,

    Static methods and properties are fully supported in version 2 with no post processing for the proxy files.  The confustion came from the SDK section "Proxies for Managed Assemblies" which incorrectly states that static types and memebers are not supported.  This contradiction has been reported and will be corrected.  The SDK section "Architecture of Generated Proxy Code" contains the correct information on how proxies are handled.  I have updated the suppliement to reflect this information and am including the main changes below.

    IV.      How the Proxy file works

     

    ProxyGen v 2 creates much different proxies than were generated by ProxyGen v 1.  In ProxyGen v 2 each exposed class from the host application has one or two (if the class is and add-in entry point) corresponding classes in the proxy layer.  Along with these two types of classes is one additional class, the ProxyServices.Helper class which is used by static methods.

     

    The first corresponding class has the same name as the class in the host application and contains non-implemented properties and methods for non-static and non-constructor methods in the host application.  Static methods and properties in the host class are fully implemented here, and available to add-ins through this class.  Constructors found in the proxy are for internal use only (proxies do not support the “new” operator).  Calls to the non-implemented methods should resolve themselves prior to the reaching the NotImplementedException in the non-implemented methods. 

     

    The second corresponding class is for add-in entry points and has the same name as the class in the host application appended with “EntryPoint”.  These classes contain code to allow communication between the add-in and host and for are fully implemented.  These implemented methods are similar to the methods produced by ProxyGen v 1.  Static methods and properties are not included in these entry point classes; instead, they are resolved using the first corresponding class and the ProxyServices.Helper class.

     

     

    IX.3           Static Properties and Methods 

     

    Static properties and methods appear in the descriptor file with the property isStatic=”true”.  Non-static properties and methods do not have this property in the descriptor file.  Static properties and methods are implemented in the proxy in the corresponding non-entry point classes and use the ProxyServices.Helper class to communicate remotely with the host.  If the class containing the static properties and methods is an add-in entry point, the static properties and methods are not carried over to the corresponding entry point class in the proxy file.  Static methods and properties must be accessed only in reference to the containing class, not to a specific instance of the class. 

     

    For example, in the ShapeAppBasicCSharp sample, the Application class has the static property MinShapeSize and static method CreateSize.  For an application level add-in to set the MinShapeSize the calls must be made through the class, not through the “this” instance of the class.

     

    Correct:

    Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Application.MinShapeSize = Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Application.CreateSize(100, 100);

     

    Incorrect:

    this.MinShapeSize = this.CreateSize(100, 100);

  • 12-19-2007 10:15 AM In reply to

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    Thank you Gary and Melody for your comments.

    I still haven't been able to investigate the CTP properly, but the part of not allowing Constructors is a hard one to win me over from, as it completely breaks the way C# and DotNet in general is programmed in. One of the major benefits of the code we wrote to allow Constructors and static methods in VSTA is that once the user's VSTA addin grows too big ( as they inevitably do) he/she can easily transfer the code into a "real" addin (which we also allow) and with very few changes be able to reuse the code. With the "VSTA" flavor of C#, this isn't possible, and instead all code have to be "un-VSTA"ed.

    To allow the user a transparent VSTA experience, being able to write the code just as he would normally do for any application in C#/DotNet is, from my point of view, essential. If I had to eat my own dogfood and develop applications through APIs that were limited in the "off the shelf" VSTA way, I would go bonkers. :-)

    The use of constructor methods on the Application object might suit smaller applications, but it's really not a nice way to program, IMHO. VBA-people will ofcourse disagree with me. ;-)

    Anyhow, have a great Christmas. I really, really do hope that the other projects will go away so I can focus on this stuff for the first quarter of 2008.. You think I can ask Santa to fix this for me? I _have_ been a good boy...

    /Henrik

  • 12-19-2007 10:17 AM In reply to

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    Ah, ok, that looks a lot better... Well, maybe Santa came in early this year ;)
  • 01-12-2008 3:43 PM In reply to

    • Melody
    • Top 10 Contributor
    • Joined on 04-26-2007
    • Syracuse, NY
    • Posts 245

    Re: ProxyGen v 1 Issues addressed in ProxyGen v 2 CTP Release

    There is an updated VSTA v 2 release available.  To access the release, go to the VSTA 2.0 SDK CTP Now Available blog and follow the instructions. This release includes changes and fixes to the samples (they work now!), documentation, ProxyGen, and other bugs.  Please check it out and let us know what you think!

    Thanks!
    -Melody
Page 1 of 1 (8 items) | RSS
Copyright Summit Software Company, 2008. All rights reserved.