T
Tomás Hernández
My code downloaded from OPENETCF.org show this error in the call to the API.
I´m trying this in the WindowsCE.net emulator.
Any know the solution to that exception???
Any suggestion will be appreciate. Thnx
An unhandled exception of type 'System.MissingMethodException' occurred in
OpenNETCF.Net.dll
[DllImport("cellcore.dll",EntryPoint="ConnMgrEnumDestinations",SetLastError=
true)]
internal static extern int ConnMgrEnumDestinations(int nIndex, IntPtr
pDestinationInfo);
public DestinationInfoCollection EnumDestinations()
{
DestinationInfo destInfo = new DestinationInfo();
IntPtr hDestInfo = IntPtr.Zero;
DestinationInfoCollection dests = new DestinationInfoCollection();
bool loop = true;
int i = 0;
int ret = 0;
do
{
hDestInfo = MarshalEx.AllocHLocal((uint)DestinationInfo.NativeSize);
ret = ConnMgrEnumDestinations(i++, hDestInfo); // THE EXCEPTION IS THROWED
HEAR.
if(ret == -2147467259)
{
loop = false;
break;
}
DestinationInfo cm = new DestinationInfo(hDestInfo);
dests.Add(cm);
MarshalEx.FreeHLocal(hDestInfo);
}
while(loop);
return dests;
}
I´m trying this in the WindowsCE.net emulator.
Any know the solution to that exception???
Any suggestion will be appreciate. Thnx
An unhandled exception of type 'System.MissingMethodException' occurred in
OpenNETCF.Net.dll
[DllImport("cellcore.dll",EntryPoint="ConnMgrEnumDestinations",SetLastError=
true)]
internal static extern int ConnMgrEnumDestinations(int nIndex, IntPtr
pDestinationInfo);
public DestinationInfoCollection EnumDestinations()
{
DestinationInfo destInfo = new DestinationInfo();
IntPtr hDestInfo = IntPtr.Zero;
DestinationInfoCollection dests = new DestinationInfoCollection();
bool loop = true;
int i = 0;
int ret = 0;
do
{
hDestInfo = MarshalEx.AllocHLocal((uint)DestinationInfo.NativeSize);
ret = ConnMgrEnumDestinations(i++, hDestInfo); // THE EXCEPTION IS THROWED
HEAR.
if(ret == -2147467259)
{
loop = false;
break;
}
DestinationInfo cm = new DestinationInfo(hDestInfo);
dests.Add(cm);
MarshalEx.FreeHLocal(hDestInfo);
}
while(loop);
return dests;
}