Jump to content

Java calling Windows COM DLL's

- - - - -

  • Please log in to reply
4 replies to this topic

#1
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
I was curious to know if anybody has ever found an elegant way to call functions in a Windows COM DLL from Java.

I'm needing my program to acquire images from WIA (Windows Image Acquisition) compatible scanners and cameras. (Our scanners are not TWAIN compatible.) The WIA Automation COM object is located in C:\Windows\System32\wiaaut.dll and provides functions for discovering the connected WIA devices and acquiring images.

I've searched and only managed to come up with some commercial packages that add this functionality to Java, but I can't spend money on this task. :) Anyone have a better way to do it? (If I can avoid having to write a wrapper program in C/C++, I'd like that.)
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
com4j maybe?

#3
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Hmm, when I try to download com4j, I get the following message:
The file /web/projects/com4j/servlets/ProjectDocumentList appears to be missing.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#4
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Good point...

Edit: Subversion for source seems to work tho, maybe you can compile it yourself :p

Edit2: wonder what this is Com4j: Downloads — Java.net

Edit3: the above link works (downloaded the smallest rar, as it's the newest I think) It also contains samples.

#5
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Excellent. Thank you. I'll give it a try.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users