Skip to content
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

java.lang.IllegalArgumentException #62

Open
lacigas opened this issue Dec 7, 2017 · 1 comment
Open

java.lang.IllegalArgumentException #62

lacigas opened this issue Dec 7, 2017 · 1 comment

Comments

@lacigas
Copy link

lacigas commented Dec 7, 2017

Hi
I get an IllegalArgumentException when calling a method in a com dll.

My code is the following:
IManager manager = ClassFactory.createManager();
String bstrFile = "1.xml";
String pbstrSchema=new String();
Holder<IRequest> ppIRequest = new Holder<IRequest>();
Holder<IResult> ppIResult = new Holder<IResult>();
manager.load(bstrFile, pbstrSchema, ppIRequest, ppIResult);

The C/C++ Interface has the following signature
HRESULT load(BSTR bstrFile,
BSTR *pbstrSchema,
IRequest **ppIRequest,
IResult **ppIResult)

Stacktrace:

Exception in thread "main" com4j.ExecutionException: java.lang.IllegalArgumentException
	at com4j.ComThread.execute(ComThread.java:236)
	at com4j.Task.execute(Task.java:40)
	at com4j.Wrapper$InvocationThunk.invoke(Wrapper.java:345)
	at com4j.Wrapper.invoke(Wrapper.java:184)
	at com.sun.proxy.$Proxy3.loadXML(Unknown Source)
	at test.DllCall.DllCall.main(DllCall.java:25)
Caused by: java.lang.IllegalArgumentException
	at com4j.Wrapper.<init>(Wrapper.java:82)
	at com4j.Wrapper.create(Wrapper.java:98)
	at com4j.NativeType$5.toJava(NativeType.java:279)
	at com4j.StandardComMethod.invoke(StandardComMethod.java:55)
	at com4j.Wrapper$InvocationThunk.call(Wrapper.java:356)
	at com4j.Task.invoke(Task.java:50)
	at com4j.ComThread.run0(ComThread.java:172)
	at com4j.ComThread.run(ComThread.java:153)

Any idea what could be wrong?
Thanks for your help!

@btrajkovski
Copy link

btrajkovski commented Apr 6, 2020

I'm facing the same problem, did someone managed to solve this issue? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants