FIX: COM Object Returns Incorrect Value for BoolID: Q162966
|
Calling an Automation method that returns a Boolean value is interpreted incorrectly from Java. If the COM object returns True, Java interprets the return value as False, or if it returns False, then Java interprets the return value as True.
The problem has been fixed with the latest Microsoft virtual machine (Microsoft VM). Please follow the link to http://www.microsoft.com/java to download the latest Microsoft VM.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual J++ 1.1.
import server.* // where server is the MFC Automation Server
class javabool
{
public static void main(String args[])
{
System.out.println("\nStarting test...\n");
IBoolTest btest = (IBoolTest) new BOOLTEST();
btest.TestBool(); //calling the Automation
Method
System.out.println(btest.TestBool());
}
}
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, 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: Java VM Bool COM
Keywords : kbVJ100bug kbVJ110fix JCOM
Version : 1.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 27, 1999