Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / October 2006

Tip: Looking for answers? Try searching our database.

Why doesn't OnConnection() get called when I enable an Add-In?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
munglet@hotmail.com - 21 Oct 2006 01:05 GMT
I'm new to writing AddIns for 2005 and I'm just trying to do the basics
at this point.

I'm having trouble understanding why OnConnection() is only being
called when I debug the Add-in from the IDE and not when I enable the
add-in from the Add-In Manager.

Example:
I create an add-in using the wizard.
I put debug message boxes in the Connect() and OnConnection() methods.
When debugging the plugin and I get both messages.
Close the debug IDE instance and now the add-in appears in the add-in
manager.

In the primary IDE instance when I go to Add-In Manager and enable my
add-in I only get the message box from the Connect() method.  Why don't
I get the message box from the OnConnection() method?

Thanks for any help on understanding the flow better.

-Marcus
munglet@hotmail.com - 21 Oct 2006 01:11 GMT
Why is it that I discover the anser *right after* I post the
question????

Anyway, there is no problem.  My problem was that message box was
inside an if() statement and I didn't realize that.  Like I said I'm a
newb in this arena so I didn't inspect the code that was generated by
the Add-In wizard that closely.

Example:

if(connectMode == ext_ConnectMode.ext_cm_UISetup)
{
MessageBox.Show("FOOBAR");
}

mung...@hotmail.com wrote:
> I'm new to writing AddIns for 2005 and I'm just trying to do the basics
> at this point.
[quoted text clipped - 17 lines]
>
> -Marcus
Carlos J. Quintero [VB MVP] - 23 Oct 2006 12:49 GMT
Hi Marcus,

I am glad that you solved your problem. But since you are newbie, ensure
that you understand the ext_ConnectMode.ext_cm_UISetup flag reading my
articles:

    - INFO: Visual Studio .NET Add-In Commands Disappear On Next Session
     - HOWTO: Adding buttons, commandbars and toolbars to Visual Studio
.NET from an add-in

at: http://www.mztools.com/resources_vsnet_addins.htm

because it is not an easy thing.

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

> Why is it that I discover the anser *right after* I post the
> question????
[quoted text clipped - 33 lines]
>>
>> -Marcus

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.