I have turned an old FORTRAN code into a COM server and written a GUI C#. The COM server runs a simulation and saves the results in an allocatable real(4) 2D array (referenced ObjectData%export). So far I am picking off each element using a for loop in C#. This is a painful process because 'export' is typically aound the size (20,6000), which means 120,000 calls to the COM method. Its taking longer than the actual simulation itself.
I want to pass the entire 'export' array (which is 2D but of changing length) in onego toC#.From what I have read, I need toout the data ina SafeArray andwrap it in a Variant, before passing to C#. Can anyone help me with this?
Sorry if this is a really newbie question. I just started working with FORTRAN last week.