Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Terrarium 1.2 strange error
 

Terrarium 1.2 strange error

Ok when i compile my critter...no problem

try to drop it in the terrarium and i get error:
Error Loading Assembly: you are calling a class that isnt allowed in ...[my function addy]

when i go to the function here is the offending code (actually simplified):

Dim pointXY As Point

Dim DirectionArray = New ArrayList(8)

For Each pointXY In DirectionArray

Next

If I comment out the For Next loop everything loads in fine.

What is goin on?

Anyone

Triad APA  Wednesday, October 05, 2005 11:50 PM
That is strange.  I've used foreach several times in my bugs with no problems (albeit I'm using C#).  As a matter of fact, Locust iterates through an ArrayList of Points just like the code you posted.  Perhaps VB implements foreach differently than C#?  Using something Terrarium considers unsafe?  If it's just the use of foreach that's causing the problem, you can work around that fairly easily.  However, I suspect there's more to it than that.  I once experienced a similar problem.  I had compiled with the wrong version of the .Net libraries.  Perhaps that could be causing this?  Let me know what you find out.
dkocur2  Friday, October 07, 2005 4:44 AM
Just a guess, but I think Terrarium might not like the name "DirectionArray".  (Maybe there's an internal class or property by that name.)  Try naming it something else.
dkocur2  Thursday, October 06, 2005 3:08 PM
thanks, but no go....for some reason it does not like the  for each loop, and I can not figure it out to save my life.
Triad APA  Thursday, October 06, 2005 5:00 PM
That is strange.  I've used foreach several times in my bugs with no problems (albeit I'm using C#).  As a matter of fact, Locust iterates through an ArrayList of Points just like the code you posted.  Perhaps VB implements foreach differently than C#?  Using something Terrarium considers unsafe?  If it's just the use of foreach that's causing the problem, you can work around that fairly easily.  However, I suspect there's more to it than that.  I once experienced a similar problem.  I had compiled with the wrong version of the .Net libraries.  Perhaps that could be causing this?  Let me know what you find out.
dkocur2  Friday, October 07, 2005 4:44 AM

You can use google to search for other answers

Custom Search

More Threads

• Does teleporting deserialize creature state correct?
• Unable to use GetCurrentWebBrowser
• Install issue
• Registery value of the MSBuild.exe
• source code download
• Hyper terminal
• help in datagridview
• Where do you enter your code for your creature
• IssueVision New User staffer
• WindowsApllications In Multithreading