BUG: JavaTLB Generates Invalid Classes for MFC ServerLast reviewed: January 29, 1998Article ID: Q165550 |
The information in this article applies to:
SYMPTOMSUsing 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 CAUSEThis happens only when you add automation methods to your MFC Automation Server (via ClassWizard) that take parameters of pointer type like BSTR*, long*.
RESOLUTIONThe 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_METHODThis allows JavaTlb to generate a valid class file, and the server works as expected when called from Java or Visual Basic.
STATUSMicrosoft 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.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor 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:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ |
Additional query words: bstr* COM
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |