a question about c#, vb and vc.net

  • Thread starter Thread starter www.brook
  • Start date Start date
W

www.brook

I have a class defined in C#, which read the data into the memory

//c# code
public class ModelDataIO
{
public: Double [] m_data;
}

I have a c++ code which process the data
public __gc class Model
{
public: bool train(Double *pData, int nSize);
}

Then I call the code in vb
dim mod as Model
dim mio as ModelDataIO
'load the data in....
mod.train(mio.m_data(0), mio.m_data.Length)

It compiles ok, but incurs a run time error,
"System.NullReferenceException"
It is clear that passing mio.m_data(0), is not correct, but It will be
correct for an array declared in vb

eg: dim a(100) as Double
mod.tran(a(0),100) will be correct.

Can anyone tell me how to fix the problem?

Thanks in advance
 
Back
Top