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 / January 2008

Tip: Looking for answers? Try searching our database.

Usercontrol destroyed ? (reference object becomes null?!)q

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carsten - 03 Jan 2008 16:44 GMT
Hi

I Have a real strange problem here,
I create a ToolWindow of an UserControl like this

---------------------------------------------------------------
 else if (connectMode == ext_ConnectMode.ext_cm_AfterStartup)
           {
                try
               {
                     string guidString =
"{91EDB65F-4B6D-440E-8032-16FD874E0F6A}";
                   Windows2 windows2 = (Windows2)_applicationObject.
Windows;
                   Assembly asm = Assembly.GetExecutingAssembly();
                   toolWindow = (Window2)windows2.
CreateToolWindow2(_addInInstance, asm.Location,
                       "CommentAddin.IdlBrowser", "Idl Browser", guidString,
ref programmableObject);

                   // If tool window was created successfully, make it
visible
                   if (toolWindow != null)
                   {
                       toolWindow.Visible = true;
                   }

               
                   
                   //toolWindow.SetTabPicture( ((System.Drawing.Bitmap)
(resources.GetObject("icon"))).GetHbitmap());
                   idlBrowser = programmableObject as IdlBrowser;
                   if (idlBrowser == null)
                       MessageBox.Show("  null");
                   tv = idlBrowser.treeView1;
                   MessageBox.Show(tv.Nodes[0].Text);
               }
            catch (System.Exception ex)
           {
               MessageBox.Show(ex.Message);
           }
         
               
           }
-------------------------------------------------------------------
Well this works ! I have a treeView on my control ,
And the messageBox shows me the correct String.
Well I catch the WindowActivated event and
the idlBrowser object is null !!  as long as I am in this slope everything
is fine , but after it the reference object
is null , how can this happen ?

Regrets ,
Jazz

url:http://www.ureader.com/gp/1545-1.aspx
Carsten - 04 Jan 2008 15:08 GMT
Hi

I solved it myself,
I just needed to set my memebers to static ...

Greetz

url:http://www.ureader.com/msg/15451144.aspx

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.