10 Replies Latest reply on Feb 13, 2017 7:39 AM by Adel Sari

    Application crashing when moving from CE5 to CE7

    John Sidwell

      MC3090 -> MC32N0 Upgrade Issues



      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.



      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?

        • Re: Application crashing when moving from CE5 to CE7
          Christopher Sather

          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.

            • Re: Application crashing when moving from CE5 to CE7
              Daniel Silva

              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.

              • Re: Re: Application crashing when moving from CE5 to CE7
                John Sidwell

                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())





                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 

              • Re: Application crashing when moving from CE5 to CE7
                Christopher Sather

                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.

                • Re: Application crashing when moving from CE5 to CE7
                  Hao-Fan Ma

                  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!


                  • Re: Application crashing when moving from CE5 to CE7
                    Adel Sari


                    we are facing the same error, on MC3200 CE7,


                    any help is appreciated.