Microsoft KB Archive/325741

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

Article ID: 325741

Article Last Modified on 8/7/2003

-

APPLIES TO


 * Microsoft Visual J# .NET 2003 Standard Edition
 * Microsoft Visual J# .NET 2003 Standard Edition

-



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.



Steps to Reproduce the Behavior
 Create a Visual J# .NET class library that contains a class with an inner class.  Create a constructor for the inner class that takes an integer as its only parameter. public class OuterClass {   class InnerClass {       public InnerClass(int x)        { }   } }                     Create a Visual C# .NET console application and add a reference to the Visual J# .NET class library.  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. 

Additional query words: inner constructor parameter

Keywords: kbprb KB325741

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.