3 messages in net.java.dev.jna.users[jna-users] null pointer
FromSent OnAttachments
chri...@gmx.deDec 9, 2008 1:35 am 
Nikolas LotzDec 9, 2008 1:59 am 
chri...@gmx.deDec 9, 2008 2:53 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:[jna-users] null pointerActions...
From:chri...@gmx.de (chri@gmx.de)
Date:Dec 9, 2008 1:35:40 am
List:net.java.dev.jna.users

Hello,

I searched the mailing list archive, but I didn't find anything helpful.

I have a problem calling a C++ function.

Here is the part of the header-file:

#define DCSLoadBalancer_Handle void* DCSLoadBalancer_Handle DCSLoadBalancer_FormatDocument (void* pDCSLoadBalancer,
void* pData, long lData, char* pPool, DCSLoadBalancer_Handle hProcessID, void*
callbackfunction, void* pParam)

In my interface I declared the function:

Pointer DCSLoadBalancer_FormatDocument(Pointer pDCSLoadBalancer, String
pData,long lData, String pPool, Pointer hProcessID, Pointer callbackfunction,
Pointer pParam);

Now when I call:

String pPool = ... String xmlString = ... Pointer hDocID =
DCSLBLibrary.INSTANCE.DCSLoadBalancer_FormatDocument(pDCSLoadBalancer,
xmlString, xmlString.length(), pPool, null, null, null);

I get an error because the null pointer of hProcessID (5th parameter) doesn't
reach the C++ function. The parameter hProcessID in the C++ function
DCSLoadBalancer_FormatDocument gets an address.

What happens with this pointer object between the java call and the c++ call?

Can anybody help me?

Thanks in advance! Chris