Connection Manager. C#

  • Thread starter Tomás Hernández
  • Start date
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;
}
 
P

Peter Foot [MVP]

To narrow it down even more it is supported on the following platforms
(which support .NETCF):-
Pocket PC 2002
Pocket PC 2003
Smartphone 2003

So all versions of Pocket PC except the original Pocket PC 2000 devices. The
component is specific to Windows Mobile and is not even available as an
option to CE.NET platform builders.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

Alex Yakhnin said:
I beleive ConnManager is specific to PPC/Smartphone platform only.

--
Alex Yakhnin, NET CF MVP
IntelliProg, Inc.
http://www.intelliprog.com

Tomás Hernández said:
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;
}
 
T

Tomás Hernández

thanks for reply, I will try it with RAS api but is very difficult.

Peter Foot said:
To narrow it down even more it is supported on the following platforms
(which support .NETCF):-
Pocket PC 2002
Pocket PC 2003
Smartphone 2003

So all versions of Pocket PC except the original Pocket PC 2000 devices. The
component is specific to Windows Mobile and is not even available as an
option to CE.NET platform builders.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

Alex Yakhnin said:
I beleive ConnManager is specific to PPC/Smartphone platform only.

--
Alex Yakhnin, NET CF MVP
IntelliProg, Inc.
http://www.intelliprog.com

Tomás Hernández said:
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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top