BUG: JavaTLB Generates Invalid Classes for MFC Server (165550)
The information in this article applies to:
- Microsoft Visual J++ 1.0
- Microsoft Visual J++ 1.1
This article was previously published under Q165550 SYMPTOMS
Using JavaTLB on the TLB files created from MFC ClassWizard generated ODL
code generates class files that give the following run-time error:
ERROR:java.lang.ClassFormatError
CAUSE
This happens only when you add automation methods to your MFC Automation
Server (via ClassWizard) that take parameters of pointer type like BSTR*,
long*.
RESOLUTION
The workaround is to modify the generated .odl file with [in,out]
attributes on the automation methods that take pointer type arguments:
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(PtrTest)
[id(1)] void TestBstr([in,out]BSTR* arg1);
[id(2)] void TestLong([in,out]long* arg1);
//}}AFX_ODL_METHOD
This allows JavaTlb to generate a valid class file, and the server works as
expected when called from Java or Visual Basic.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
REFERENCES
For the latest Knowledge Base articles and other support information on
Visual J++ and the SDK for Java, see the following page on the Microsoft
Technical Support site:
Modification Type: | Minor | Last Reviewed: | 8/25/2005 |
---|
Keywords: | kbbug KB165550 |
---|
|