My codes (that were working with the 2024 version) do not work anymore with the 2025 release. this is the error I get in the function “InitConnection()”:
Message: Could not load file or assembly 'ZemaxEngine.dll' or one of its dependencies. The dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) Source: mscorlib HelpLink: None
Page 1 / 1
Hi Luca,
You might want to try changing the directory mentioned in this post. Hopefully, it will help.
Hi all, I am facing the same problem and updating to the latest Matlab (ie version R2024b) did not solve the problem. The method CreateNewApplication()results in the same error:
Message: Could not load file or assembly 'ZemaxEngine.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) Source: mscorlib HelpLink: None
FYI, I am using OpticStudio 2025.
Hi bostanem,
Would you please try the version below?
Julia
Hi Julia, Thanks a lot. It seems that I can install Update 5 (and not 4). Would that be okay?
Hi bostanem,
I just updated my Matlab to Update5, I experience no error with this version.
Thanks Julia, this seems to fix the issue for me. I appreciate your help.
Date: April 29, 2025.
The latest available from Matlab is now R2024b, update 6 (not 5). When I install update 6 of Matlab, I have the same problem, using the sample scripts from Zemax: