c#调用C++写的DLL,提示未将对象引用设置到对象的实例,帮帮小弟我

c#调用C++写的DLL,提示未将对象引用设置到对象的实例,帮帮我啊
函数原型:
int   Split(char*   a,char*   b)
b用于返回结果。

我在.NET中这样写
[DllImport( "FreeICTCLAS.dll ",EntryPoint= "Splitword ",ExactSpelling=false,CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]
public   static   extern   int   Splitword(string   a,   ref   string     b);
int   nTime=Splitword(strSource,ref   strResult);


运行报错:未将对象引用设置到对象的实例

------解决方案--------------------
不好意思...
写错 string strResult = " "
但这样你还是得不到你要的数据.

如果是传出来的数据应该用StringBuilder;

这样改...
public static extern int Splitword(string a, StringBuilder reply);

CharSet可能是CharSet.Ansi...

调用时
StringBuilder sb = new StringBuilder(512);申请空间

int nTime=Splitword(strSource,sb);

------解决方案--------------------
因为string一旦建立是不可改变的.