Click here to Skip to main content
15,948,155 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am new to C#.
I am using a COM Component from Interop.ImcCoreLib which is a dll reference added to the C# project.
There is a .dat file saved in the form of Channels, Segments and Events by a data measurement SW from Imc. The COM Interop dll has classes and functions to access the data in the same format.
the below is the code that I am using:

DFile protfile = new DFile(); //DFile is from the dll
var m = protfile.ReadChannel(1).get_Event(1).Data; //all 5000 data points of type double saved in m

But the problem is that m is of datatype System.Double[*]

Type thisType = protfile.ReadChannel(temp0).get_Event(temp1).GetType();
When I execute the above line, i get the type as "System.__ComObject"

I am unable to access the individual data sample in m and I also am unable to cast this m to a normal System.Double[]

Any help would be grateful.

Thank You.
BillWoodruff 21-Oct-15 8:56am    
Try this:
Nagaraj053 28-Oct-15 6:23am    
Thank u BillWoodruff,
I managed to solve the casting problem.
But however, there is a completely different problem.
now that i am able to read the data from individual files, there are infact multiple files say like 100+ files.
For each file, i am using this below line to open the file, process the data, save into an excel, close the file and open the next file for processing and saving and so on..
Each file is of 70MB and after processing around 45 files, i am facing insufficient temporary memory error. [even though lots of RAM memory available]
Tried with the GC.Collect() and IDisposable methods. (I did go through lots of books and websites about implementation of GC)
Still I have the memory problem.
any help on this would be greatful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900