Skip to content

How to use JavaCPP to Create an Object Instance for an Abstract C++ Class associated with a Win32 DLL? #703

Answered by cartel1
cartel1 asked this question in Q&A
Discussion options

You must be logged in to vote

I solved this problem by creating a C wrapper 64 bit DLL for the target Win 64 bit DLL variant of the Win 32 bit DLL. Then, I used the jextract tool to create Java FFM (Foreign Function and Memory) bindings that allowed me to interact with the target Win 64 bit DLL.

The limitation encountered when trying to directly interface with both target 32 bit and 64 bit DLLs was that 64 bit JVMs are now not supporting 32 bit DLLs and both DLLs are using __stdcall function call standard which is not supported by Java/Java FFM. Therefore, it was necessary to create the wrapper DLL which uses __cdecl function call standard which allowed Java to indirectly integrate with the target DLL.

Also, a C wrapp…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@cartel1
Comment options

Comment options

You must be logged in to vote
2 replies
@cartel1
Comment options

@cartel1
Comment options

Answer selected by cartel1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants