3 messages in net.java.dev.jna.usersanother access violation problem
FromSent OnAttachments
Hai Yun TaoAug 19, 2007 4:31 am 
Hai Yun TaoAug 19, 2007 12:37 pm 
Timothy WallAug 27, 2007 12:43 pm 
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:another access violation problemActions...
From:Hai Yun Tao (hytp@hotmail.com)
Date:Aug 19, 2007 4:31:28 am
List:net.java.dev.jna.users

I'm interfacing with speex.

Here are my signatures in C (from speex.h)

__declspec(dllexport) void* speex_encoder_init_nb(); __declspec(dllexport) void speex_encoder_destroy(void *state);

According to the api in speex in C, i shall get the void* from the init, and use
it (blah blah blah), when doing the clean up, put this void* back to destroy()

now here is my java version

public interface LibSpeex extends StdCallLibrary { public static final LibSpeex instance = (LibSpeex )Native.loadLibrary("libspeex", LibSpeex.class);

Pointer speex_encoder_init_nb(); void speex_encoder_destroy(Pointer state); }

Access violation occurs when i call destroy in this case. I tried to change the
parameter of destroy method from Pointer to PointerByReference but to no avail. FYI, the code works without access violation when executed in c (i.e. when the
function was called in C if the program is in C)

Did i map the datatype wrongly?

Million thanks on the help.

_________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx