BUG: User-Defined Parameter Names Lost When Creating COM Objects (221948)



The information in this article applies to:

  • Microsoft virtual machine

This article was previously published under Q221948

SYMPTOMS

When creating a Java-implemented COM object with Visual J++ 6.0 or the Microsoft SDK for Java, the Microsoft virtual machine (Microsoft VM) creates a typelib where any user-define names that were used as parameters to methods are lost or renamed to Parameter0, Parameter1, and so forth.

CAUSE

This is a limitation in how the Microsoft VM creates TypeInfo.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. From the Visual J++ 6.0 File menu, click New Project.
  2. Select Components and create a default COM DLL (Project1).
  3. Open Class1.java.
  4. Create a public method as follows:
    public void demo (int MyInt)
    						
  5. Build the project.
  6. From the Project menu, click Add COM Wrapper.
  7. Find the new COM object created (if default was used you will find "Project1").
  8. Now view Class1.java within the wrapper class folder (project1) found in the Project Explorer window
  9. Find the "demo" method that looks like the following:
    public native void demo(int Parameter0);
    						
  10. You will notice that MyInt gets renamed to Parameter0.
If you were to create a Visual Basic client for a Java-COM object whose methods have user-defined names for parameters, you will notice that its IntelliSense shows these arguments as Paramter0, Paramter1, and so forth.

Other ways to see this result is through the use of OLE View, which is installed with Visual J++ 6.0. By default a shortcut to OLE View can be found under Start.Programs.Microsoft Visual J++ 6.0.Microsoft Visual J++ 6.0 Tools.

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:6/14/2006
Keywords:kbBug kbJava kbnofix KB221948