2 messages in net.java.dev.jna.usersRe: [jna-users] void * typedefs passe...
FromSent OnAttachments
Francis FernandezApr 10, 2008 7:33 am 
Timothy WallApr 10, 2008 7:42 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] void * typedefs passed by valueActions...
From:Timothy Wall (twal@dev.java.net)
Date:Apr 10, 2008 7:42:28 am
List:net.java.dev.jna.users

On Apr 10, 2008, at 10:33 AM, Francis Fernandez wrote:

Hi, I'm new to JNA, and I'm trying to work with the API for a USB camera peripheral (which doesn't register with Windows as an image capture device). One of the typedefs in the API is

typedef void * VRmUsbCamDevice

which acts as a handle for the device. I've tried including it as a PointerType, a PointerByReference, and a class that implements Callback.

Functions in the API that require a VRmUsbCamDevice to be passed as a pointer work fine, but some of the functions require that it be passed by value:

int VRmUsbCamOpenDevice (const VRmDeviceKey *fcp_device_key, VRmUsbCamDevice *fp_device) int VRmUsbCamCloseDevice(VRmUsbCamDevice f_device);

VrmUsbCamDevice is Pointer or PointerType. When asked for VrmUsbCamDevice*, you must provide a PointerByReference (and use .getValue() to assign your PointerType's value) or write your own <YourPointerType>ByReference.