PRB: Visual J# .NET Inner Class Signature Requires Outer Class When Accessed from Other .Net Languages (325741)



The information in this article applies to:

  • Microsoft Visual J# .NET (2002)
  • Microsoft Visual J# .NET (2003)

This article was previously published under Q325741

SYMPTOMS

When you access a Visual J# .NET inner class constructor from a Microsoft .NET language other than Visual J# .NET, you must use the outer class as the first parameter. This is true for the binaries that are generated by using both the Visual J# compiler (Vjc.exe) and the Visual J# binary converter tool (Jbimp.exe).

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create a Visual J# .NET class library that contains a class with an inner class.
  2. Create a constructor for the inner class that takes an integer as its only parameter.
    public class OuterClass
    {
    	class InnerClass
    	{
    		public InnerClass(int x)
    		{
    		}
    	}
    }
    					
  3. Create a Visual C# .NET console application and add a reference to the Visual J# .NET class library.
  4. In the main function of the application, create an instance of the Visual J# .NET inner class that is defined in the class library:
    static void Main(string[] args)
    {
    	OuterClass oc = new OuterClass();
    	OuterClass.InnerClass ic = new OuterClass.InnerClass(oc, 10);
    }
    						
    Notice that the inner class constructor takes two parameters: the first is an instance of the outer class, the second is the parameter to the constructor to the inner class constructor.

Modification Type:MajorLast Reviewed:8/7/2003
Keywords:kbprb KB325741