• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java & Activex  RSS feed

 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oe of my collegue asked this question to me ..
Is it possible to access any Activex from a java code ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could write access methods with JNI, and run that code in an applet. Its a pretty stupid thing to do though. If you are using ActiveX its because you know you are supporting IE only - I'd ask your colleague why they want to do this.
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do they want an ActiveX to be embedded inside an applet? I dont think that's possible because you need the windows handle to attach an ActiveX control.
Do they just want call ActiveX methods? they can do that through JNI. I have done that and it's pretty simple to do as long as you know C++ and COM
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:
I'd ask your colleague why they want to do this.


The requirement is as follows.
There is a VB activex that controls a hardware .. This guys needs his application to interact with that hardware ....
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jayesh Lalwani:

Do they just want call ActiveX methods? they can do that through JNI. I have done that and it's pretty simple to do as long as you know C++ and COM

Yes they need to call the methods in the activex control.
But tell me one thing how can Java be used to call a vb method using JNI.
I have heard abt this but dont know more ... Also i have writtern small small programs using JNI that calls a C++ method ..
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by srini vasan:

Yes they need to call the methods in the activex control.
But tell me one thing how can Java be used to call a vb method using JNI.
I have heard abt this but dont know more ... Also i have writtern small small programs using JNI that calls a C++ method ..


You can call a "VB" ActiveX control through any language that supports COM, which includes C++. Actually there is nothing like a VB activeX control. I think what you mean is an ActiveX control written in VB. Well, it doesnt matter what language the ActiveX control is written in, you should be able to call the ActiveX control from a JNI dll written in C++.

But, I wouldnt advise you to do that unless you have someone who has a pretty good working knowledge of C++ and COM. If you dont have someone who is an knowledgable in Windows and COM prgramming, then you have a pretty steep learning curve to get over
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!