FuncPtr2 J/Direct Sample

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

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This example demonstrates a more advanced use of the com.ms.dll.Callback class. It displays all installed fonts.

To create a function pointer in Java

  1. Write a class that derives from com.ms.dll.Callback.

  2. Implement a public method named callback (all lowercase).

    The callback method must be non-static, accept only integers as parameters, and return a value that has the integer, boolean, char, short, or void data type.

  3. Create an instance of your new class and pass it as the function pointer argument.

Using the Sample

To run the sample

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

Key Project Files

FuncPtr2.java

This class contains the following two classes:

Technologies Demonstrated

Microsoft J/Direct

This sample shows how to:

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