• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNA can be used to access COM based dll ?  RSS feed

 
Bhavin Shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I am having two dlls, one is C based and one is Microsoft COM based. Can I use a single JNA(https://jna.dev.java.net) library to access both dlls from my java applicatiobn ? or is there any other library that i can use for this purpose ?

I can access only C library using JNA. for accessing COM based library there is com4j(https://com4j.dev.java.net/). But I need only one library for both purpose.. Any Idea?
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the facade design pattern.
This facade class then has references to both smaller libraries. For each method you want available, create it and just call the smaller librarry methods:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!