Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PPC2003 PIE will not connect to localhost

14 views
Skip to first unread message

Chris McKay

unread,
Jul 2, 2003, 5:50:34 PM7/2/03
to
Here is the issue:

Pocket Internet Explorer under Windows Mobile 2003 is unable to connect to a
local instance of Windows CE HTTP server unless there is a pre-existing
Network Connection. This behaviour differs from Pocket PC 2002.

Secondly, localhost is not recognised as a valid hostname for connection,
even when a valid network connection exists only http://127.0.0.1 works.

The first problem always existed in PPC2000 and a group of developers who
were connected up through this news group got around this problem by faking
a RAS connection. (this is where ieFix came about from www.cam.com), another
company commissioned a TCP loopback adapter as the RAS connection had the
unfortunately side effect of breaking ActiveSync.

These are the things I am about to try, any thoughts from the group are
welcome.

1. The ugly RAS hack doesn't work. I get an ERROR_DEVICE_DOES_NOT_EXIST code
on the RasDial which is fair enough.

2. I could try to get a network loopback adapter developed. Last time I did
find a guy who wanted to charge US$10K to do this, so we declined and went
for the RAS hack.

3. Perhaps I could develop a minimal browser with HTMLView which I
understand has been improved. Hopefully the problem we are seeing isn't in
InternetOpenURL. I guess our application might lose a few bells and whistles
(we've got a few JScript tweaks and an ActiveX control) but that might work
in the interim. I've just completed my 400Mb download of eVC4 so wish me
luck!

Chris


Chris McKay

unread,
Jul 2, 2003, 10:25:11 PM7/2/03
to
An update:

> These are the things I am about to try, any thoughts from the group are
> welcome.
>
> 1. The ugly RAS hack doesn't work. I get an ERROR_DEVICE_DOES_NOT_EXIST
code
> on the RasDial which is fair enough.
>
> 2. I could try to get a network loopback adapter developed. Last time I
did
> find a guy who wanted to charge US$10K to do this, so we declined and went
> for the RAS hack.

Anyone who is interested email me at chris_mckay-at-hotmail.com

> 3. Perhaps I could develop a minimal browser with HTMLView which I
> understand has been improved. Hopefully the problem we are seeing isn't in
> InternetOpenURL. I guess our application might lose a few bells and
whistles
> (we've got a few JScript tweaks and an ActiveX control) but that might
work
> in the interim. I've just completed my 400Mb download of eVC4 so wish me
> luck!

OK the demos of browse and HTMLHost fail with same error (Cannot Connect -
no modem/network card) when I change the NAVIGATE url to http://127.0.0.1
and compile and run on the device with eVC4

Jay McLain [MSFT]

unread,
Jul 7, 2003, 11:24:59 AM7/7/03
to
We have identified this as a problem with Pocket IE under Windows Mobile
2003. We are currently providing this description of the problem, and a
workaround.

DESCRIPTION:
If you don't have a WORK network set up in Connection Manager, attempts to
connect to "localhost" will fail.

127.0.0.1 works because Connection Manager thinks it's on the INTERNET.

WORKAROUND:
Use the device when it is cradled, making sure to set
ActiveSync->Options->Rules->Pass Through to "Work" connection. This way the
device thinks it's on the WORK network and http://localhost will work.
(Note that 127.0.0.1 won't work in this config, but you can fix that by
putting it in Settings->Connections->Advanced->Select Networks->Exceptions
list.)


--
___________________________________
Jay McLain
Software Development Lead - Pocket IE
Mobile Devices Division
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


"Chris McKay" <chris...@hotmail.com> wrote in message
news:3f035824$1...@news.orcon.net.nz...

Chris McKay

unread,
Jul 7, 2003, 10:14:20 PM7/7/03
to
Thanks for the reply Jay,

I hate to appear ungrateful as I know you are excellent in monitoring this
news group, but I am sure you're aware that the "Mobile" description of the
operating system tends to imply using the device further than the length of
a USB cable away from your PC.

Any information regarding a fix to PIE or the availability of a local
loopback adapter from Microsoft?

Note that this problem negates the documented usage of the embedded HTTP
server in the eVC4 help documentation.

The HTMLView samples in eVC4 also fail with similar behaviour to that
displayed by Windows CE HTTP server.

Chris


"Jay McLain [MSFT]" <ja...@online.microsoft.com> wrote in message
news:uZnwuvJR...@TK2MSFTNGP12.phx.gbl...

Aaron Filner [MSFT]

unread,
Jul 8, 2003, 7:22:01 PM7/8/03
to
Hi Chris,

I spoke about this further with Jay and other members of our development
team. It should be possible to get loopback to work if you have any network
connection configured for the device. Please try one of the following:

1. If you have some way for ConnMgr to get to the Internet, then use
127.0.0.1

2. If you have some way for ConnMgr to get to the Work network, then use
localhost.

3. If you need to use a host name you can put a static one in the "hosts"
file (on CE this is in the registry).

If you have a network card, you should statically address the card through
Settings->Connections->Advanced->Network Card and set "My network card
connects to" the appropriate setting for #1 or #2 above.

hopefully this helps,
-A

___________________________________

Aaron Filner

Program Manager - Pocket IE Mobile Devices Group

Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"Chris McKay" <chris...@hotmail.com> wrote in message

news:OUZ%23saPRD...@TK2MSFTNGP11.phx.gbl...

Chris McKay

unread,
Jul 8, 2003, 11:26:24 PM7/8/03
to
Hi guys,

Yes, I have installed a Socket CF ethernet card in an iPAQ H2215 and with it
not connected to any LAN everything works fine. Good to know I could also
resolve the localhost issue but I have control over the URL for my
application so that is not really an issue for me. Our first release for our
application on PPC2003 is with iPAQ 5450's so I am hoping the integrated
wireless connections in that device will enable me to run in the same way. I
haven't tested this as yet.

But ...

There is another large trial in the offing using the H2215s, I can't go back
to this customer and say everything will work fine if you purchase network
cards at $150 a seat. I'm looking for a software solution such as a local
loopback adapter as is available for Windows PCs (i.e. to run the eVC
emulator for instance) I don't suppose there is such a beast roaming the
halls of Remond?

Thanks for your replies, I feel bad about my sarcasm in my previous post now
...

Chris

"Aaron Filner [MSFT]" <aaro...@online.microsoft.com> wrote in message
news:Ol1KAfaR...@TK2MSFTNGP11.phx.gbl...

Chris McKay

unread,
Jul 13, 2003, 12:47:00 AM7/13/03
to
OK I've been trying a few things. I have been assuming that PIE must execute
a call that triggers the need for an active network connection. So I've run
through everything that looks likely in wininet.

What I was hoping is that I could substitute/override this function in my
executable if this is possible to get past the call. I'm happy to use the
HtmlView control and write my own app instead of using PIE.

BUT ...

All the following calls complete without opening the "Cannot Connect"
dialog. It is opened when the NAVIGATE message is sent to the Control.

So what call or parameter is triggering it? Is this a valid way to get
around my problem? Is my only alternative to write a local looback adapter
and create a new network device?

Any ideas?

Regards,
Chris


Sample code from a modified Browse sample

#define IDS_START_PAGE TEXT("http://127.0.0.1/home.htm")

...

MessageBox(hWnd, TEXT("Before InternetAttemptConnect"), TEXT("Debug") ,
NULL);
InternetAttemptConnect(0);
MessageBox(hWnd, TEXT("Before InternetCheckConnection"), TEXT("Debug") ,
NULL);
InternetCheckConnection((LPTSTR)IDS_START_PAGE, FLAG_ICC_FORCE_CONNECTION,
NULL);
MessageBox(hWnd, TEXT("Before InternetOpen"), TEXT("Debug") , NULL);
hInternetConn = InternetOpen(TEXT("winLauncher"),
INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hInternetConn) {
MessageBox(hWnd, TEXT("Before InternetOpenUrl"), TEXT("Debug") , NULL);
hWebServerProbe = InternetOpenUrl(hInternetConn, (LPTSTR)IDS_START_PAGE,
NULL, NULL, INTERNET_FLAG_RELOAD, 0) ;

...

SendMessage(hWndHtml, DTM_NAVIGATE, 0, (LPARAM)(LPTSTR)IDS_START_PAGE);

Bingo dialog appears


Chris McKay

unread,
Jul 13, 2003, 4:46:00 AM7/13/03
to
OK, I am a genius.

Looks like I can achieve all I want with InternetOpenUrl, InternetReadFile,
the HTML control and the Browse example. Just need to get images displaying
and I think I'm there. As far as our app is concerned it probably is better
from a marketing view to hide Pocket Internet Explorer anyway.

Speed seems OK, need to test Javascript - yep that works - nice HTML Control
guys.

No idea what PIE is doing - I hope you guys aren't using any undocumented
APIs! :)

So I guess I'm done. If anyone is having the same problem and wants some
sample code email me.

Chris


Jay McLain [MSFT]

unread,
Aug 11, 2003, 11:16:50 AM8/11/03
to
Here is a possible workaround to this isssue that one of the developers on
my team (thanks Randy!) has 'discovered'. This solution creates a Connection
Manager "null" network and maps all local host accesses (via a URL) to that
network. I hope this helps!


Create a file called _setup.xml with the following contents:

<wap-provisioningdoc>
<characteristic type="CM_Mappings">
<characteristic type="536870911">
<parm name="Pattern" value="*://localhost/*" />
<parm name="Network" value="{e8e89f5a-d3bb-4c58-9b4e-08279d31044e}" />
</characteristic>
</characteristic>

<characteristic type="Registry">
<characteristic
type="HKLM\Software\Microsoft\ConnMgr\Providers\{EF097F4C-DC4B-4c98-8FF6-AEF
805DC0E8E}\localhost-null">
<parm name="DestId"
value="{e8e89f5a-d3bb-4c58-9b4e-08279d31044e}" datatype="string" />
<parm name="Type" value="0" datatype="integer" />
<parm name="Enable" value="1" datatype="integer" />
</characteristic>
</characteristic>
</wap-provisioningdoc>

Create a CAB Provisioning File as outlined on MSDN at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/amo_ppc/htm/creating_a_cab_provisioning_format_cpf_file_zvvq.asp?frame=true


Place the CPF file on your device and tap on it in File Explorer. The CAB
installer will process it and delete the file. There is no visual feedback.

At this point, you should be able to use http://localhost to access the
local web server without a network connection.


--
___________________________________
Jay McLain
Software Development Lead - Pocket IE
Mobile Devices Division
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


"Chris McKay" <chris...@hotmail.com> wrote in message

news:%23Koajnc...@TK2MSFTNGP10.phx.gbl...

Chris McKay

unread,
Aug 12, 2003, 10:41:11 PM8/12/03
to
I'll try this out guys, I've also notified a few people who emailed me
directly regarding this issue, of course now I am quite attached to my own
notPIE app ... having implemented a back/history button, mailto: links etc

C

"Jay McLain [MSFT]" <ja...@online.microsoft.com> wrote in message

news:%23HNpjuB...@tk2msftngp13.phx.gbl...

0 new messages