| | |
calling dll from java application using Jacob
![]() |
•
•
Join Date: Nov 2007
Posts: 84
Reputation:
Solved Threads: 0
Hi there,
I need to call a dll file that was written in VB.Net, in my java application using the jacob [com.jacob.com] ,
after successfully registering the dll file, I am trying to instantiate an ActiveXComponent object using my dll, :
where Myfile.dllfile is currently placed in regedit under HKCR,
but running the application give me the following exception :
any help please? what I am missing.
Thanks in advance.
I need to call a dll file that was written in VB.Net, in my java application using the jacob [com.jacob.com] ,
after successfully registering the dll file, I am trying to instantiate an ActiveXComponent object using my dll, :
•
•
•
•
ActiveXComponent myComp = new ActiveXComponent("Myfile.dllfile");
but running the application give me the following exception :
•
•
•
•
com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstance(Native Method)
Thanks in advance.
there's always something to learn
•
•
Join Date: Apr 2008
Posts: 972
Reputation:
Solved Threads: 146
Can you see Myfile.dllfile in olewiew?
I've used Jacob with iTunes and
Alternatively, have a look at com4j (Google it). It's not as smart as Jacob in terms of its thread handling, and can't handle as wide a range of COM interfaces, but when it works it's 100% easier to use.
I've used Jacob with iTunes and
new ActiveXComponent("iTunes.Application"); works 100%. If you have iTunes maybe you could see if that works for you.Alternatively, have a look at com4j (Google it). It's not as smart as Jacob in terms of its thread handling, and can't handle as wide a range of COM interfaces, but when it works it's 100% easier to use.
•
•
Join Date: Nov 2007
Posts: 84
Reputation:
Solved Threads: 0
Thanks for replying,
I am afraid that I have no idea about "olewiew" !
in addition I do not have the iTunes,
and the jacob worked fine with the already installed files such (word.application , excel ....... etc) , but not with the registered dll file.
trying any other alredy exist files such the word.Basic, works very nice ,
suggestions!
I am afraid that I have no idea about "olewiew" !
in addition I do not have the iTunes,
and the jacob worked fine with the already installed files such (word.application , excel ....... etc) , but not with the registered dll file.
trying any other alredy exist files such the word.Basic, works very nice ,
suggestions!
there's always something to learn
•
•
Join Date: Apr 2008
Posts: 972
Reputation:
Solved Threads: 146
oleview is an old Microsoft utility that lets you browse the complete interface definitions for all registered COM objects etc.
It gets the info directly from the objects, so it's the most current and credible source, and will immediately show if your problem is with the object or Jacob. If you Google it you'll be able to track down a legit. download source.
I agree about Jacob working well; I've not hit anything yet that it can't cope with. The hardest thing is to make sure that you have released every comthread properly at the end of the run (including the swing EDT and any callbacks from COM), otherwize you can get problems trying to run your app a second time without re-starting the server.
I do think it's pretty hard to use - you have to experiment to find out what kind of objects to pass it, and what kind it returns, and you can only do that at runtime. Com4j pre-processes the COM interface and generates a complete set of type-safe Java wrappers, so it's very much easier to use. (Jacob has an unfinished wrapper generator, but I've never been able to get it to work). For serious apps I use Com4j to get all the calls and logic right, then replace them with the Jacob equivalents for reliability and speed.
It gets the info directly from the objects, so it's the most current and credible source, and will immediately show if your problem is with the object or Jacob. If you Google it you'll be able to track down a legit. download source.
I agree about Jacob working well; I've not hit anything yet that it can't cope with. The hardest thing is to make sure that you have released every comthread properly at the end of the run (including the swing EDT and any callbacks from COM), otherwize you can get problems trying to run your app a second time without re-starting the server.
I do think it's pretty hard to use - you have to experiment to find out what kind of objects to pass it, and what kind it returns, and you can only do that at runtime. Com4j pre-processes the COM interface and generates a complete set of type-safe Java wrappers, so it's very much easier to use. (Jacob has an unfinished wrapper generator, but I've never been able to get it to work). For serious apps I use Com4j to get all the calls and logic right, then replace them with the Jacob equivalents for reliability and speed.
![]() |
Similar Threads
- Error while calling dll from asp.net (ASP.NET)
- JNDI/JDBC lookup problem with Sun Java Application Server 8.2 (Java)
- How to hide an java application (Java)
- How to create an exe for a Java application (Java)
- Can any one help me with java application (Java)
- finding ip thru a java application (Java)
- How to Open a word doc from a java application? (Java)
- Adapting a Java Application to JSP/Servlets (Java)
Other Threads in the Java Forum
- Previous Thread: getdetails(java.lang.String[]) cannot be applied to ()
- Next Thread: testing
| Thread Tools | Search this Thread |
account android api applet application array arrays automation awt bidirectional binary birt bluetooth busy_handler(null) chat class classes client code columns component database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source plazmic print problem program programming project property recursion ria scanner search server set smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree webservices windows





