Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:
  #1  
Old 02-24-2005, 04:21 PM
lucbrunet lucbrunet is offline
Registered User
 
Join Date: Feb 2005
Posts: 46
Runtime Error 340

Hi, I have a program where I am creating several controls at runtime using the control array method. So I have a Shape with it's index set to zero, and at the click of a button I create a new control with the load statement and it gets placed on the form with an index of 1 and so on. However, everytime I do this, when I unload the form I get this error:

Runtime Error 340: Control array element '1' doesn't exist

Do I have to manually unload all the created controls? Any ideas what this could mean?
Reply With Quote
  #2  
Old 02-24-2005, 06:03 PM
mstraf's Avatar
mstraf mstraf is offline
Senior Member
 
Join Date: Nov 2003
Location: Alameda, CA
Posts: 1,648
Do you have some code in the Unload or QueryUnload events?
Marco
Reply With Quote
  #3  
Old 02-25-2005, 10:13 AM
lucbrunet lucbrunet is offline
Registered User
 
Join Date: Feb 2005
Posts: 46
Nothing that has anything to to do with the newly created controls, should there be?
Reply With Quote
  #4  
Old 02-25-2005, 03:40 PM
mstraf's Avatar
mstraf mstraf is offline
Senior Member
 
Join Date: Nov 2003
Location: Alameda, CA
Posts: 1,648
well, I was wondering if there was code that was causing the error. Do you get the problem in the IDE? Can you debug and trace where the error is?
Marco
Reply With Quote
  #5  
Old 02-25-2005, 04:20 PM
lucbrunet lucbrunet is offline
Registered User
 
Join Date: Feb 2005
Posts: 46
Actually I found what the problem was. I was passing the controls to certain custom made classes, when the form was unloaded the controls would unload, and then the classes would unload. In the class I was also trying to unload the passed control (which was already unloaded from the form) and hence, my error.

Thanks!!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:37 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.