Guys,
Can anyone please tell me what this native exception means?
I am using RasGetConnectStatus to find out the status of RasDial
connection. when it is not connected and there is no handle to the
connection ( hConnection=0) then it works fine but if there is a
handle it always give me this error. here is the code.
[StructLayout( LayoutKind.Sequential)] class RASCONNSTATUS
{
public int dwSize;
public int rasconnstate;
public int dwError;
//[System.Runtime.InteropServices.Marshal( UnmanagedType.ByValTStr,
Size=17) ]
public String szDeviceType;
//[Marshal ( UnmanagedType.ByValTStr, Size=129) ]
public String szDeviceName;
public RASCONNSTATUS( )
{
dwSize = Marshal.SizeOf ( this) ;
}
}
[DllImport("Coredll.dll", CharSet=CharSet.Unicode)]
private static extern int RasGetConnectStatus (int hRasConn,
ref object lpRasConnStatus);
public class RasDial
{
RASCONNSTATUS rasCon= new RASCONNSTATUS();
result = RasDial(IntPtr.Zero, null, data,
0, IntPtr.Zero, ref Global.hConnection); object o=(object)rasCon;
int ret=RasGetConnectStatus(Global.hConnection, ref o);
}
Please please help me to find out what I am doing wrong.
cheers
Rushi