Dear all,
I have a WinForm/WPF project where I want to use ZOS-API.
The console application from ray tracing example file works fine. However, when I added ZOS references (ZOSAPI, ZOSAPI_Interfaces, ZOSAPI_Nethelper) to the WinForm project (compiled for x64), I got a null reference, like so:
I’ve made minimum modifications to the original example of the ray tracing program. Basically, I just wrapped it into a separate class and removed the Main method, because the WinForm project already has an entry point.
The program could be succesfully initialized, which means ZOSAPI references linked to the project:
Found OpticStudio at: c:\program files\zemax opticstudio
However, after new connection created, “TheApplication” reference is null:
IZOSAPI_Application TheApplication = TheConnection.CreateNewApplication();
I appreciate it if anyone knows the cause of this null reference.
Regards,
Mykyta