FILE: JWindow Demonstrates How to call Win32 APIs from JavaLast reviewed: January 29, 1998Article ID: Q177162 |
The information in this article applies to:
SUMMARYThe JWINDOW sample illustrates how to call Win32 APIs from a Java application. This sample contains a single class called JWindow which basically creates a Window by using the Win32 API CreateWindow and displays "Hello JWindow" in the client area by processing the WM_PAINT in the WndProc. This sample illustrates how to use the @dll.import directives to invoke a Win32 DLL function from Java, callbacks, and nested struct types. The following file is available for download from the Microsoft Software Library:
~ JWindow.exe (size: 27618 bytes)For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online Services MORE INFORMATIONThe JWINDOW sample contains JWindow.java, which calls the standard Win32 DLLs and illustrates how to use the @dll.import directives to invoke the DLL functions from Java. To use J/Direct, you need to have installed the latest version of the Microsoft Compiler for Java (Jvc.exe version 1.02.4337 or higher) and the latest version of the Microsoft Virtual Machine for Java (version 2252 or higher). Both the compiler and the Virtual Machine are available with the Microsoft SDK for Java version 2.0. When executing this Java application , if you encounter an UnsatisifiedLinkError, then check your version of the compiler. If your compiler does not support J/Direct, the Microsoft Win32 Virtual Machine for Java will attempt to link native methods using the Raw Native Interface and hence will not succeed.
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: J/Direct Win32 directives
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |