2

I am currently migrating my Compact Framework 2.0 application to the new Windows Embedded 7 Compact machines and had to recompile it for CF 3.5. It compiles but does not run at all.

I am using OpenNETCF version 2.3 and before I start my debugging process I would like to confirm that it is indeed compatible with Compact Framework 3.5.

Edited

These are the components I am using:

  • using OpenNETCF.IO;
  • using OpenNETCF.Windows.Forms;
  • using OpenNETCF.WindowsCE;
  • using OpenNETCF.WindowsCE.Notification;
  • using OpenNETCF.Threading

The choking happens when I create the object that belongs to the class that implements IMessageFilter, see code below

  public class Program
        {
           public static FormFilter myFilter = new FormFilter();  //chocking happens here!
    
            public static void Main(string[] args)       
            {
              //main code here
            }


    public class FormFilter : IMessageFilter
    {
        private frmMain _frmOwner;

        //messages
        static int WM_LBUTTONDOWN = 0x0201;
        const int WM_CLOSE = 0x0010;
        const int WM_KEYDOWN = 0x100;

        //button related:
        private List<Button> buttonList;
        private List<TextBox> txtBoxList;

        public FormFilter()
        {
            buttonList = new List<Button>();
            txtBoxList = new List<TextBox>();
        }

        public bool PreFilterMessage(ref Microsoft.WindowsCE.Forms.Message m)
        { }

        //watch buttons etc functions go here
} //end of FormFilter class
} //end of Program
halfer
  • 19,824
  • 17
  • 99
  • 186
sarsnake
  • 26,667
  • 58
  • 180
  • 286
  • What Windows Embedded 7 Compact machines are you working with? Haven't started seeing these yet myself. Compact Framework 3.5 supports the new OS? – tcarvin Aug 24 '12 at 14:15

2 Answers2

3

Yes, the SDF 2.3 is compatible with Compact Framework 2.0 or 3.5. Without knowing exactly which pieces you're using, I can't help much further on what might be causing the app to not run.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • Thanks, Chris. I updated the question. When I click on the app on Windows 7 Embedded Compact, I get "ApplicationName stopped working" message. – sarsnake Aug 23 '12 at 19:35
  • So in other words, the P/Invoke you do as part of OpenNETCF should work on this new O/S? I use HP thin clients and never had to get any special SDKs, it's a standard device. – sarsnake Aug 23 '12 at 20:00
  • I have made some progress, Chris and it looks like SDK 2.3 won't work here. I removed all references to it and commented out the code and got the app to display the "hello" message. I use Threading and Application2 quite a bit and not sure what the alternatives would be or how to proceed in this case. – sarsnake Aug 23 '12 at 20:34
  • Specifically, IMessageFilter is causing it to choke. Any thoughts on what to do? – sarsnake Aug 23 '12 at 20:46
  • The only suggestion I can make is to debug into it and see what's happening. I use the SDF under 3.5 all the time - as recently as yesterday - so I know for absolute fact it works. I'm using the IMessageFilter, so I'm also positive that works. The question is why is it failing. Is it a type load issue maybe? The debugger is the best way to tell. – ctacke Aug 23 '12 at 21:06
  • I am getting the following warning when compiling (maybe that will shed some light).C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly. – sarsnake Aug 23 '12 at 22:09
  • It appears that the problem is when calling the constructor of the object belong to the class that implements IMessageFilter. When I comment out the :IMessageFilter, no choking happens. The constructor doesn't do anything OpenNETCF specific - it just creates 2 objects of List type...so it must be a loading issue then. Any ideas as why? Are there any additional dlls required? What are my choices now? Debug the app using the source code? I wasn't doing anything different that before... – sarsnake Aug 23 '12 at 22:41
  • I updated the code. Unfortunately, I don't use VS2008 debugger in smart device apps as I was never able to make the emulator work. All the debugging is done directly when deploying on the device. – sarsnake Aug 23 '12 at 22:46
  • You don't have to debug with an emulator, you can debug against physical hardware just fine (I very rarely use an emulator). There are no additonal DLLs needed other than the CF 3.5 stuff. My bet is that you have a desktop DLL getting sucked in somewhere, but you'll have to find it by cleaning out all bin and obj folders, cleaning the device, and verifying every reference in the solution. – ctacke Aug 23 '12 at 23:03
  • thanks. You mean desktop dll sucked in where? In the same directory as my application.exe? Nope, it has a very minimal number of dlls. I have already verified all the references and rebuilt the solution for CF 3.5. And the device "problem details gives a very cryptic error as usual. APPCRASH. Exception code e0434f4d. I guess I will have to catch the exception to see more info. – sarsnake Aug 23 '12 at 23:15
  • my other solution would be to create a brand new app that uses OpenNETCF IMessageFilter and try running it. Do you have an example (zip file) of an app that is verified to work on CF 3.5? I have to document what works and what doesn't when doing this migration and I am getting completely stuck as no error details is provided anywhere and there doesn't seem to be much I can do at this point. Thanks again. – sarsnake Aug 23 '12 at 23:21
  • Do you think it can be a P/Invoke issue with the O/S being different from Windows CE? I can't explain this any other way. It's APPCRASH event name and fault module name is KERNELBASE.dll. – sarsnake Aug 23 '12 at 23:31
  • Chris, please see this question when you get a chance http://stackoverflow.com/questions/12186167/unable-to-load-dll-coredll-dll-the-specified-module-could-not-be-found – sarsnake Aug 29 '12 at 20:48
1

It turns out that I am a running Windows Embedded Standard that is not Windows CE so OpenNETCF dlls will not run on it.

Please see Unable to load DLL 'coredll.dll' : the specified module could not be found for more detailed answer from Chris.

Community
  • 1
  • 1
sarsnake
  • 26,667
  • 58
  • 180
  • 286