各位 
我在C#.NET中调用VC编的DLL动态链接库,其中DLL中有一个含结构体的函数,我在C#中如何调用?以下我是这样做的, 
C#声明: 
[DllImport("gprsdll.dll",EntryPoint="DSGetModemByPosition"] 
 public static extern int DSGetModemByPosition(int pos,ref modem_information infor);//返回为1成功,其中modem_information为结构体,其类型为 
 public struct modem_information 
            {public uint modem_id;   //modem ID号 
              public byte[] phone_num;   / 号码 
              public UInt32 connect_time;//登陆时间 
              public UInt32 refresh_time;//刷新时间 
              public byte[] dynamic_ip;//动态地址 
            }  
我在调用时先定义了一个结构体对象,并对其初始化 
modem_information modem=new modem_information(); 
modem.dynamic_ip=new byte[4];  
modem.phone_num=new byte[12]; 
 int success=my.DSGetModemByPosition(i,ref modem); 
my为DSGetModemByPosition所在的一个类的对象 
dll中DSGetModemByPosition是这样定义的: 
struct __POSITION { };
typedef __POSITION* POSITION;
int DSGetModemByPosition(int pos,ModemInfoStruct * modeminfor)//ModemInfoStruct为结构体,其定义类型与上述C#定义一样的 
int DSGetModemByPosition(int modempos, ModemInfoStruct *pModemInfo)
{
//这个操作应当是互斥的
//todo_edw
 int inx=0;  POSITION pos;
if (modempos<glstPtrModemInfoStructs.GetCount())
{
ModemInfoStruct*pMi;
// pMi=glstPtrModemInfoStructs.GetAt(pos);
POSITION pos;
pos=glstPtrModemInfoStructs.GetHeadPosition();
while(pos!=NULL)
{
pMi=glstPtrModemInfoStructs.GetAt(pos);
if (inx==modempos)
{
break;
} inx++;
glstPtrModemInfoStructs.GetNext(pos);
} memcpy(pModemInfo,pMi,sizeof(*pModemInfo));
return 1;
}
else
{
guiLastError=ERR_MODEMNOTFOUND;
return 0;
}
}
到最后编译时DSGetModemByPosition总是通不过 
那位大侠指点下,我错在哪里 ???