ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   General - SDK

Subject: Re: Problem with looping through nodes in c#
Sender: neil.danson@gmail.com 9.03.06 10:21

I think that this may be a bug in VS2005. If i mport the control and the VRMLAutomation in 2005 I cannot use the foreach loop, but I can in 2003. The answer would appear to be to create the assembly wrappers using VS2003 and then reference them in VS2005. Simple........

N
If I try and loop through the nodes of a scene, I get this kind of error -
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Here's the code I am using

for (int i = 0; i < vrNodes.Count;i++ )
    {
    try
    {
    object oi = i;
    VRMLAutomation.VRMLNode vrNode = vrNodes.get_Item(ref oi);

    TreeNode tn = trNode.Nodes.Add(vrNode.Name + " - " + vrNode.TypeName);
    tn.ForeColor = Color.Red;
    }
    catch (Exception E)
    {
    System.Diagnostics.Debug.WriteLine(E.Message);
    }
    }

A few nodes dont throw exceptions, but many many more do - fo example- in my test scene there are 955 nodes, but only about 10 dont erro with this code. The error always seems to be the same.

Any ideas?

Regards

Neil


 


Problem with looping through nodes in c# / neil.danson@gmail.com / 6.03.06 07:32
     Re: Problem with looping through nodes in c# / neil.danson@gmail.com / 9.03.06 10:21

Messages in thread: 2


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.