This sample is located in \Samples\JDirect\Funcptr1.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
This sample shows how to use the com.ms.dll.Callback class to simulate function pointers in Java.
To create a function pointer in Java
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.
To run the sample
Run Go.bat in the \Samples\JDirect\Funcptr1 directory.
This class contains the following two classes:
Different calls to EnumWindows are likely to use different child classes, but they all derive from EnumWindowsProc. Therefore, they can use the common declaration of EnumWindows, which is prototyped to accept an EnumWindowsProc.
This sample shows how to: