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

ID: Q221948


The information in this article applies to:


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 this to be a bug in the Microsoft products 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 the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, please see the following pages on the Microsoft Technical Support site:

http://support.microsoft.com/support/visualj/

http://support.microsoft.com/support/java/

Additional query words:


Keywords          : kbCOMt kbJava kbJavaVM kbVJ600bug kbGrpJava 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 27, 1999