Host Item Events cause Host App to crash

Latest post 05-27-2008 11:23 AM by Melody. 19 replies.
  • 05-22-2008 10:50 AM In reply to

    • Terry
    • Top 10 Contributor
    • Joined on 05-10-2006
    • Posts 76

    Re: Host Item Events cause Host App to crash

    When you say created... do you mean instantiated?  If so, I instantiate the FileEventArgs Object right when I call the RaiseAddInEvent:

    Me.RaiseAddInEvent(FileInitializedEvent, Me, New FileEventArgs(Me.Name))

    Sounds like you are saying that this file event args object needs to be available to the GetHostObject() method in order to make it through to the AddIn?  If that's the case, I understand and then don't all at the same time because it works when I just do a plain old RaiseEvent. Does the pipeline take care of things automatically when you use RaiseEvent?

    thx.

     

  • 05-22-2008 11:25 AM In reply to

    • Terry
    • Top 10 Contributor
    • Joined on 05-10-2006
    • Posts 76

    Re: Host Item Events cause Host App to crash

    After considering this for another minute I realized this might be valuable.  These are in my HostItemProvider:

    canonicalToTypeName.Add("Machine, PGT.Win.Component.ElectricalControls.Machine.FileEventArgs", GetType(PGT.Win.Component.ElectricalControls.Machine.FileEventArgs))

    typeToCanonicalName.Add(GetType(PGT.Win.Component.ElectricalControls.Machine.FileEventArgs), "Machine, PGT.Win.Component.ElectricalControls.Machine.FileEventArgs")

    I think you might have been suggesting that the issue was here and not in the GetHostObject method.  But, The entries do exist, so I'm not sure that this is the issue.

    Thx.

  • 05-23-2008 9:37 AM In reply to

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

    Re: Host Item Events cause Host App to crash

    Terry,
    Those entries do need to be in the HostTypeMapProvider in order for the types to be translated between the host (actual types) and the add-in (transparent proxies). 

    If you are getting transparent proxies on the host side then either something is not working with the HostTypeMapProvider or how the event and event args and created and raised.

    Can you send me a reproducable sample so I can see what is going on and show you how to fix it? 

    Thanks,
    -Melody
  • 05-27-2008 10:41 AM In reply to

    • Terry
    • Top 10 Contributor
    • Joined on 05-10-2006
    • Posts 76

    Re: Host Item Events cause Host App to crash

    Confession time?  Maybe... you be the judge.

    I had some new issues with my customization code running that had similar symptoms to the thing we are trying to track down here.  Now, with all the complexities going on I can't say for sure but I think I've managed to resolve the issue from this thread by fixing a related problem.

    When my Host Application loads the DTE, it extracts all methods and code for all to-be host items from a database.  It then parses through the signatures in the results and uses the DTE's API for managing code items and manually re-creates the entire project from scratch.  Well, I seem to have had some of my signature parameters reversed, which caused some other problems.  My only guess is that the event I was using for testing my issues on this thread had a similar problem (or maybe not synchronized between Release and Debug Dlls).  So, after resolving the other problems with signatures and starting from scratch with my addIn project the events appear to be firing just fine through the event helper method even when I re-load the addin multiple times and hit the same event.

    In the end I think your video clip helped me track down the larger issue of parameter translation, which helped me relize where my root problem was.

    Of course, there are parts of this that don't completely make sense but it's quite stable and all working as it's supposed to so I'm going to put this one to bed.

    Thanks!

  • 05-27-2008 11:23 AM In reply to

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

    Re: Host Item Events cause Host App to crash

    Great-  I'm glad you were able to get pass this!

Page 2 of 2 (20 items) < Previous 1 2 | RSS
Copyright Summit Software Company, 2008. All rights reserved.