Comments (5)
If anyone is interested in producing a patch for this: Looks like at a minimum you would have to add support for Holders in native/variant.cpp:convertToVariant() (starts at line 253)
from com4j.
Looks like com4j does not handle Holder arguments to IDispatch methods (arguments to an IDispatch method must be variants, and com4j does not currently know how to turn Holders into Variants). If the interface is a dual, then you could try using the non-IDispatch version.
from com4j.
I'm having the same problem when I trying to access the VaxSIPUserAgentOCX. I obtain the COMObject, but when I call a method (any method) get the error. I not understand the yours answers and I not know C/C++/C#. Could you explain me better?
StackTrace:
"... 8000ffff Invocation failed: (null) : Catastrophic failure : .\com4j.cpp:82
at com4j.Wrapper.invoke(Wrapper.java:166)
at com.sun.proxy.$Proxy5.setLicenceKey(Unknown Source)
at exercc.testeCOM.main(testeCOM.java:32)".
This is the method in the interface:
@DISPID(2)
boolean setLicenceKey(
java.lang.String licenceKey);
I generate a .IDL in the oleview:
[id(0x00000002)]
VARIANT_BOOL SetLicenceKey(BSTR LicenceKey);
Any help is very wellcome!
Thanks in advance.
from com4j.
This is not the same error as above. It comes from the same source line (com4j.cpp:82) because that is the line that catches any errors on the native side of things and translates it to a Java exception.
I do not know what the problem is in your specific instance. It could be a problem with your IDL, a bug in COM4J, a problem in the code you are calling, or incorrect arguments you are passing. Since this is not the same issue, a better place for this question would be the COM4J users mailing list. Given the current activity level on COM4J I wouldn't expect much of a response unfortunately. Sorry to be so unhelpful.
from com4j.
Thank you, honestly. You're the first person to answer me.
Here's my method call:
testVax2.wsh._DVaxSIPUserAgentOCX test = (testVax2.wsh._DVaxSIPUserAgentOCX) ClassFactory.createVaxSIPUserAgentOCX();
String key = "Here I insert the license key";
System.out.println("test ("+test+")");
test.setLicenceKey(key); //here the error occurs
It passes a Hex String as argument, that's all. I checked that the bstr type is similar to a String, and the argument from Java IS a String. Could it be the argument, then? It looks like the same type to me. I don't know. I followed the tutorial on http://com4j.java.net/. Sounds easy, it's a simple call, but I can't figure out that error. I've been reading about annotations and the COM4J structure, but it didn't help much. Have you ever used com4j with ocx from third parties? Do you have any example you could show me?
I'll change topics, as you said. You can answer me there, if you wish to do so.
thanks in advance.
from com4j.
Related Issues (20)
- error in namespace generation with maven plugin
- java.lang.IllegalArgumentException HOT 1
- Does it support, work with java9?
- Java definitions from a dll-library
- 3rd party libraries
- Unmarshal proper types for the elements of Collections ? HOT 1
- Marshalling between threads when using COM4J.wrap
- Methods with return type void fail when using default values
- When converting from VARIANT to Java type the target type should be boxed
- Memory corruption on IBM Websphere 9
- can you give me a demo for callback?
- UDP ports not being closed HOT 1
- Crash with openj9
- An unrecoverable stack overflow has occurred
- PortableDeviceAPI : "[ERROR] Unable to handle the type"
- Cannot convert Variant to double[]
- IADsUser.accountExpirationDate() uses wrong epoch time for date calculations HOT 1
- Download Distribution link doesnt work HOT 1
- ISearchQueryHelper::get_ConnectionString unexpected conversion type: 2
- Build for arm64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from com4j.