C
Carlos
This is a very bizare problem. So, I have a C# COM Add-in for Excel
which creates a toolbar, then pops-up meaningful windows when you
click the toolbar buttons. Everything works fine the first time.
After that, my event handlers do not get called when I click the
toolbar handlers. I've isolated the problem down to initializing a
dialog window (never actually showing the window). Explicitely, the
VisualStudio IDE is initializing the first component, failing on:
this.instructionLabel.Location = ((System.Drawing.Point)
(resources.GetObject("instructionLabel.Location")));
in InitializeComponent(). If I comment out the rest of the
initialization code from this line to "this.ResumeLayout(false);", the
event will fire every time. Note that there are plenty of lines
before this with plenty of equally 'severe' calls:
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(AuthenticationPopup));
this.instructionLabel = new System.Windows.Forms.Label();
this.userIdLabel = new System.Windows.Forms.Label();
...
this.SuspendLayout();
...
this.instructionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)
(resources.GetObject("instructionLabel.Anchor")));
...
Unfortunately, this isn't a clear relationship, as I can't duplicate
it in a simple sample app where I create the add-in, toolbar, form
(localized), and one simple label. Other things happening:
- If I comment out all of the form stuff, there is also a networking
class that basically does XML-RPC http client calls that causes the
same problem. Commenting out the 2 together allows for multiple
firings.
- I was previously developing this app as a simple COM interop
application launching it from some Excel VB code. This issue wasn't
present in that mode.
Thanks,
Carlos
versions: .NET 1.1, OfficeXP, VisualStudio.NET 2003 (latest service
packs)
which creates a toolbar, then pops-up meaningful windows when you
click the toolbar buttons. Everything works fine the first time.
After that, my event handlers do not get called when I click the
toolbar handlers. I've isolated the problem down to initializing a
dialog window (never actually showing the window). Explicitely, the
VisualStudio IDE is initializing the first component, failing on:
this.instructionLabel.Location = ((System.Drawing.Point)
(resources.GetObject("instructionLabel.Location")));
in InitializeComponent(). If I comment out the rest of the
initialization code from this line to "this.ResumeLayout(false);", the
event will fire every time. Note that there are plenty of lines
before this with plenty of equally 'severe' calls:
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(AuthenticationPopup));
this.instructionLabel = new System.Windows.Forms.Label();
this.userIdLabel = new System.Windows.Forms.Label();
...
this.SuspendLayout();
...
this.instructionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)
(resources.GetObject("instructionLabel.Anchor")));
...
Unfortunately, this isn't a clear relationship, as I can't duplicate
it in a simple sample app where I create the add-in, toolbar, form
(localized), and one simple label. Other things happening:
- If I comment out all of the form stuff, there is also a networking
class that basically does XML-RPC http client calls that causes the
same problem. Commenting out the 2 together allows for multiple
firings.
- I was previously developing this app as a simple COM interop
application launching it from some Excel VB code. This issue wasn't
present in that mode.
Thanks,
Carlos
versions: .NET 1.1, OfficeXP, VisualStudio.NET 2003 (latest service
packs)