Search code examples
c++dllautomated-testscaplcanoe

Compiling and running C++ (Contains Java Library) dll file in CAPL code


Would you please help me with my problem through the CANoe, CAPL code?

I am currently working on a project that automates the XDS110 debugger through the CAPL code, Simply by creating a C++ dll with integrating Java Library into it in order to call its APIs inside CAPL.

The problem exists when I try to invoke the Java inside the C++, The generated DLL file is compiling perfectly on CAPL without any kind of errors, but when I try to start the CANoe.. This error show up After Starting the CANoe

I have tried a lot of solutions and still got the same error, Would please clarify to me is what I am doing with the CAPL is valid and should work? and also please what are the possible scenarios to resolve this error?

Note: I have been using the CAPL C++ dll example in the CANoe help folder, it compiles and runs without the Java code correctly as expected. My Java code inside the C++

Also my operating Sytem: Windows 10 x64 and CANoe System: CANoe 14 x64

I have tried to follow this Vector Solution but the same problem occurs

https://support.vector.com/kb?id=kb_article_view&sysparm_article=KB0012229&sys_kb_id=7f25ca281b2614148e9a535c2e4bcb2c&spa=1


Solution

  • I have found the issue is within the g.DLL file generated, as each file of dll can be dependent on other dll files.

    The g.DLL file has dlls dependencies, one of them was missing "the jvm.dll" and the problem was a mis-match between 32-64bit systems,

    while building the project Visual studio was using the 32bit system and the jdk was using the 64bit system

    Solution:

    1. I downgraded to 32bit JDK and linked it with visual studio
    2. I updated the PATH environment variable with the downgraded 32bit JRE to binary folder bath

    I hope this topic with this solution will be found by a colleague in the future.