Application crashing when moving from CE5 to CE7

MC3090 -> MC32N0 Upgrade Issues

 

Background:

Our customer has software, written in .NET 3.5 Compact C#. It sends batch orders via FTP. Currently the application runs on MC3090s, and the client wants to upgrade to MC32N0 devices.

 

Problem:

On the MC32N0s the application crashes with an Access Violation to the desktop after sending 1-9 orders. This crash does not occur on the MC3090s. The crash occurs in the netcfagl.dll, and cannot be caught in the Visual Studio 2008 debugger. The crash occurs when the Order form closes and the MainMenu form is redisplayed. The MainMenu form is displayed from Application.Run(MainMenu), and it displays the Order form with a orderForm.ShowDialog() call in a using block.

 

My Investigations:

Stepping through the code, there is no obvious line of code or command that causes the crash. The crash is apparently happening somewhere in the main event loop of the MainMenu form.

 

Right now, the application launches the Motorola MSP client to check for updates after each order is sent. If I disable launching the MSP process in the background, the application will be much more stable, but not totally stable (still crashes, but takes significantly longer before crashing).

 

I checked for incorrect p-invoke calls, but all the calls used (hiding the start bar, setting the window to fullscreen) appear to release any resources they use, and I haven't found any obvious resource leaks.

 

The application uses the Rebex .NET Compact FTP/SSL library. I tried updating to the latest version, and saw no difference in stability.

 

Are there any known issues to be taken into consideration for MC32N/CE7 devices for old project migrations?

Christopher Sather
John, try adding in the

John, try adding in the attached DLL and CPY file to the root of the application folder on your device.  At my customer last year we found that the "ActivatedForm" did not fire.  Our developer created a simple stand alone app to show the error and Motorola opened a case with Microsoft to patch the netcfagl.dll for us.  IT should have rolled into newer BSP's but it did not.

The SPR was 25939.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I have seen similar issues

I have seen similar issues when running a CE5 app on CE6.  You need to explicitly dispose a form after you close it in CE6, and that wasn't required in CE5  Try adding a myForm.dispose() right after the myForm.close() on the form that is closing.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


John Sidwell
Thanks for the responses so


Thanks for the responses so far. I've tried placing the DLL and CPY in the Application folder and warm booting, but my application is still crashing the same way.

Also, all my forms are displayed in using { } blocks, so that should call dispose() automatically from what I understand.

In MainMenu.cs:

using (OrderMainForm mainFrm = new OrderMainForm())

{

    mainFrm.ShowDialog();

}

Just for reference, this is the call stack I see in the RTLog on the device:

Exception 'Data Abort' (0x4): Thread-Id=0a3c07fe(pth=a3ca2000), Proc-Id=0a57001e(pprc=a3d96cbc) 'ORDERSAPP.exe', VM-active=0a57001e(pprc=a3d96cbc) 'ORDERSAPP.exe' 

PC=4269d840(netcfagl3_5.dll+0x0000d840) RA=4269d768(netcfagl3_5.dll+0x0000d768) SP=010dfc3c, BVA=00000010 

#$# Exception 0xC0000005 <ORDERSAPP.exe> 

#$# Thread procedure: mscoree3_5.dll!0x00048D94 (in dll) 

#$# PC: netcfagl3_5.dll!0x0000D840 (in dll) 

#$# Call stack top 

#$# netcfagl3_5.dll!0x0000D840 (in dll) 

#$# mscoree3_5.dll!0x000422EC (in dll) 

#$# netcfagl3_5.dll!0x000077EC (in dll) 

#$# 0x016AC780 

#$# Call stack bottom 

#$# Exception was not handled 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
.cpy files are only processed

.cpy files are only processed on a cold boot. 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


John Sidwell
Thanks for the correction; I

Thanks for the correction; I did a cold boot with some more testing, but the newer netcfagl_35.dll doesn't seem to be solving the issue. (I did put a beep call in my mainForm.activated() event to ensure that it was triggering, and it definitely is with the patched DLL).

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Christopher Sather
More info and the attached

More info and the attached sample app we used to repro the issue.

The issue is due to the Events in Application is not getting triggered properly.

Technically Speaking , in MC 9200 when the NextGen Application's  FORM.SHOW() action upon calling is not triggering the FORM.ACTIVATED event automatically. Due to which the business logic inside the ACTIVATED function is not executed resulting this error . But the same is getting executed as expected in MC 9090.

In Order to verify if the issue is with the application or the device , I have added ACTIVATED Event call in CS_BarcodeSample1 project and tried executing it in both MC 9090 and MC 9200. I noticed the same behavior where the Activation event is not getting triggered upon calling Show/ShowDialog() in MC 9200 but is working fine in MC 9090.

So I believe there should be something to look at perspective of Win CE7 OS or Motorola Device. I have attached the Sample Project with this mail so that anyone can debug the issue. Below are the details of the change.

  1. A new ACTIVATED event has been added in the attched sample project for ABOUT (AboutForm.cs) screen.
  2. When ABOUT Screen is viewed, the myAbout.ShowDialog() is called to display the ABOUT screen, which will/should automatically call the ACTIVATED Event which will display the below Message box. ("About Activate Called")

The image "CS_BarcodeSample1-Working_CE5.jpg" shows what the modified sample should look like.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Hao-Fan Ma
Dear All,I faced the familiar

Dear All,

I faced the familiar issue now, when I back from some forms, the application exit, my form displayed through "showdialog()", have you resovled the issue?

Thanks a lot!

Max

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
As I mentioned above,  there

As I mentioned above,  there is a common issue that has been seen when moving an app from CE5 to CE6 or CE7.  You must dispose of any forms before you exit the app,  or you will see issues,  possibly hanging the entire device.  Are you moving your app from CE5 to something higher?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Postovan
Hi all!Maybe you can hlp me a

Hi all!

Maybe you can hlp me a little.

Have a simple app on wince6.0 motorola mc3190 that automatically runs rdp and fills login|password.

When i run this app on new motorola mc32N0 with ce7 on the board it gives me EAccessViolation $00011BCC.

App compiled on the latest ver. of Lazarus IDE.

Appreciate for any answers!

UPD:

Appp using .ini file to store information.

It works fine if i write that inf in code so the problem is the using .ini file.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Adel Sari
Hi,we are facing the same

Hi,

we are facing the same error, on MC3200 CE7,

any help is appreciated.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments