Java Code Examples for org.bridj.Pointer#pointerToAddress()

The following examples show how to use org.bridj.Pointer#pointerToAddress() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClearVolumeC.java    From clearvolume with GNU Lesser General Public License v3.0 6 votes vote down vote up
private static final <T> Pointer<T> getBridJPointer(final long pBufferAddress,
													final long pBufferLength,
													final Class<T> pTargetClass)
{

	final PointerIO<?> lPointerIO = PointerIO.getInstance(pTargetClass);
	final Releaser lReleaser = new Releaser()
	{

		@Override
		public void release(Pointer<?> pP)
		{
			// can't control life-cycle of
		}
	};

	@SuppressWarnings("unchecked")
	final Pointer<T> lPointerToAddress = (Pointer<T>) Pointer.pointerToAddress(	pBufferAddress,
																				pBufferLength,
																				lPointerIO,
																				lReleaser);

	return lPointerToAddress;

}
 
Example 2
Source File: ProgressHelperWindowsJava8.java    From WorldPainter with GNU General Public License v3.0 5 votes vote down vote up
WindowProgress(Window window) {
    ITaskbarList3 taskbarList;
    Pointer<Integer> hwnd;
    try {
        taskbarList = COMRuntime.newInstance(ITaskbarList3.class);
        long hwndVal = JAWTUtils.getNativePeerHandle(window);
        hwnd = (Pointer<Integer>) Pointer.pointerToAddress(hwndVal);
    } catch (ClassNotFoundException | RuntimeException e) {
        // Probably too old a Windows version
        taskbarList = null;
        hwnd = null;
    }
    this.taskbarList = taskbarList;
    this.hwnd = hwnd;
}