-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Holder parameters not supported for IDispatch methods #14
Comments
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. |
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) |
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: This is the method in the interface: I generate a .IDL in the oleview: [id(0x00000002)] Any help is very wellcome! |
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. |
Thank you, honestly. You're the first person to answer me. testVax2.wsh._DVaxSIPUserAgentOCX test = (testVax2.wsh._DVaxSIPUserAgentOCX) ClassFactory.createVaxSIPUserAgentOCX(); 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? thanks in advance. |
com4j.ComException: 80020005 Invocation failed: (null) : Type conflict. : .\com4j.cpp:82
I am getting this exception when running com4j. I am totally stuck. Can someone give me advice how to go on?
The TLB looks like this:
And here is what com4j wraps:
@DISPID(3)
int initMesswertkanal(
Holder lKanalHandle,
java.lang.String lPruefmittel,
java.lang.String strPruefauftrag,
java.lang.String strMerkmal,
java.lang.String strSensorverknuepfung,
short nMesswertberechnung,
int hWnd);
Thanks!
-Ralf
The text was updated successfully, but these errors were encountered: