Pointers J/Direct Sample

This sample is located in \Samples\JDirect\Pointers.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This sample prints out the version string of Kernel32.dll using the Microsoft® Win32® version APIs. The Pointers sample simulates pointers in Java as follows:

Note   This is an example of how to deal with particularly difficult DLL functions. The specific task of getting version information for a file can be done much more easily using the FileVersionInformation class in com.ms.util.

Using the Sample

To run the sample

Run Go.bat in the \Samples\JDirect\Pointers directory.

Key Project Files

Pointers.java

The Pointers.getVersion method in this class does the following:

The Pointers.intToHexString method generates an eight-character hexadecimal string that represents the integer value passed in. The string is padded with leading zeros as needed to make it eight characters long.

Technologies Demonstrated

Microsoft J/Direct

© 1999 Microsoft Corporation. All rights reserved. Terms of use.