Error including VS 2005 .net application to CE OS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I did the exact same thing as in article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce50/html/windowsce_kiosk.asp
..When i test it on emulator(x86_release) , the get the following error on
startup (Access Violation)

Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\PLATFORMSTARTUP.EXE'
Loaded
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\MSCOREE.DLL', no
matching symbolic information found.
Loaded 'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\STB1.EXE',
no matching symbolic information found.
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\SERVICES.EXE'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\NETUI.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\COMMCTRL.DLL'
Unloaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\PLATFORMSTARTUP.EXE'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\REGENUM.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\NOTIFY.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\OLEAUT32.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\SHLWAPI.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\WININET.DLL'
Loaded
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\MSCOREE2_0.DLL',
no matching symbolic information found.
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\SSLLSP.DLL'
Loaded
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\NETCFAGL2_0.DLL',
no matching symbolic information found.
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\CREDSVC.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\CREDPROV.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\WSPM.DLL'
Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\TIMESVC.DLL'
Unloaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\REGENUM.DLL'
15080 PID:3e3db62 TID:3e3da8a Exception 00e Thread=83e44b44 Proc=03e3db62
'STB1.exe'
15090 PID:3e3db62 TID:3e3da8a AKY=00000041
PC=000a896c(STB1.exe+0x0009896c) ESP=0e03f4a0 EA=00000010

where STB1.exe is a simple C# forms application. ?

Any idea why i get this error ?

Is it because i am missing .NET framework 2.0 dll's. All i did in catalog is
removed 1.0 and added 2.0 and built the image.

Any ideas would be greatly appreciated.

STB1.EXE is my .net executable.

Loaded symbols for
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\PLATFORMSTARTUP.EXE'
Loaded
'C:\WINCE500\PBWORKSPACES\STB1\RELDIR\EMULATOR_X86_RELEASE\MSCOREE.DLL', no
matching symbolic information found.
Loaded 'C:\WINCE500\PBWORKSPACES
 
The managed code run-time is senstive to some APIs not yet existing during
startup. It's very difficult to list a managed code program in an Init key
and have it run at startup. The crash is actually occurring in the
run-time, before your code is loaded. A better way to go about this is to
launch an *unmanaged* C/C++ executable which will wait until the APIs are
ready, calling IsAPIReady() on each one, then launch the managed
application.

Paul T.
 
SignalStarted simply tells the system you're done, so anything depending on
you in it's Init structure will wait. The shell often calls it before all
APIs are ready because not doing so would slow the boot process. That's
what the IsApiReady call is for. If you need a specific set of APIs, you
need to ensure they're ready before using them.

Of course one could argue that the CF runtime should be doing that check
internally...

-Chris
 
Paul/ctacke,

Can you please provide me with a snippet (code) that calls isApiReady based
on the article code below:

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// Since this is application is launched through the registry HKLM\Init we
need to //call SignalStarted passing in the command line parameter
SignalStarted(_wtol(lpCmdLine));
ProcessStartupFolder( );
return 0;
}

Thanks,
 
So, this is to implement an unmanaged launcher? Something like

// Wait for the GDI components to be ready to receive calls.
while ( !IsAPIReady(SH_GDI) )
{
Sleep( 500 );
}

// Wait for the Window manager to be running.
while ( !IsAPIReady(SH_WMGR) )
{
Sleep( 500 );
}

// Before continuing, wait for the shell to launch.
while ( !IsAPIReady(SH_SHELL) )
{
Sleep( 500 );
}

will, I think, be enough. If you still get a crash, you may have to look at
the other SH_xxx constants and see what might still be missing.

Paul T.
 
Paul,

I removed my .net application exe having to run at startup.Instead, after
the CE OS booted up competely i executed the exe application.when i did that
it gave me an error saying:

A native exception has occured in managed.exe(my app exe).

Is it because it does not the CF dll's ?
All i did for CF 2.0 is to include from Catalog .net CF. Does Platform
Builder automatically install CF 2.0 on target device or should i do
something ?

Please advise as i am stuck.

Thanks
 
There are multiple versions of .NET CF that you can have PB install. To get
..NET CF 2.0, you have to install a QFE for Platform Builder. The version
that comes with PB 4.2 and 5.0 is .NET CF 1.0. The .NET CF 2.0 catalog item
clearly indicates that it *is* 2.0. Are you sure you included 2.0? Is this
a dummy application that does nothing which might generate a native
exception? That would be a good test.

Paul T.
 
Paul,
Thanks for the help and reply.
I have both .net CF 1.0 and 2.0 included in my OS image.
It is the exact same application that was developed by Mike in his tutorial
below which he decribes at the end:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce50/html/windowsce_kiosk.asp

Windows form that has button (attached a action) and updating the textbox.

Should i develop my app in VS 2003 .NET ?

I also tried to debug/deploy .NET Application using VS2005 to the target
device. These are the exact steps i did:

1. Got the ip address of target
2. Plugged it in Tools-Devices-Windows CE 5.0 Device
3.ran s cerdisp on target device
4 Started ConmanClient2.exe(Target-->Run Programs...)
5.Started Cmmaccept
6. Set Windows CE 5.0 device in VS2005
7. Hit the play button and clicked on Windows CE 5.0 device to connect
8. After few minutes, it said ActiveSync not installed...

I am doing all this in emulator.
 
Those are two separate problems. Let's stick with just debugging one thing
at a time. Forget about including both versions of .NET CF. Just include
..NET CF 2.0, since that's what you're using. I don't want to go off and
view what Mike's doing there. If it's a simple application *not* doing any
P/Invokes, it's fine for the test.

Paul T.
 
We don't want to deal with both there. It obviously shouldn't be a problem,
but it's probably not tested by MS that way.

Paul T.
 
And the application is built into the OS or you're copying it over somehow?

Paul T.
 
I tried both ways:

1. Include the exe into the OS image and excuted during startup.
2. Did not include the exe, but after the OS completely booted up , i copied
the exe to the CE OS desktop and executed it.

Both 1 and 2 did not work.
 
Well, the copy-it-later is the less error-prone way, so I just wanted to
make sure that you weren't adding it to the OS, but putting it in the
MODULES section of a BIB file, which would not work...

Paul T.
 
Back
Top