Problem: B4P app vs CPU of PPC?

Discussion in 'Questions (Windows Mobile)' started by conf, Jul 8, 2007.

  1. conf

    conf Member

    I write some apps that work well on my old PPC (use Intel CPU). I just buy new PPC (use Samsung CPU) and these apps can not work. What's the problem? I think because of CPU.

    Please help me, I need my apps :(
     
  2. agraham

    agraham Expert Licensed User

    Give us some information if you want help.

    What type was your old PPC? What type is your new PPC? In exactly what way do these apps not work? What error messages (if any) are you seeing?

    I assume that you are talking about Basic4PPC apps. Does Basic4PPC itself run on this new machine?
     
  3. conf

    conf Member

    Thank you Agraham,
    My old PPC is Gigabyte g-Smart i120 (Intel CPU PXA272 416 MHz). New PPC is Eten M700 (Samsung SC3 2442 400 MHz). When I run some apps, wait cursor appear but nothing happen/work. Another app still work but when I close, it got an error (Windows Mobile error).

    Ps: Sorry for my bad English.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Does the Basic4ppc editor work properly on the device?
     
  5. conf

    conf Member

    Hi Erel, B4P editor work ok on my device. I tested this simple code:

    Code:
    Sub Globals

    End Sub

    Sub App_Start
       Sound(
    "sound.wav")
       Sleep(
    6000)
    End Sub
    Seem it's running but I hear nothing. I think the problem is "sound function" of B4P because another software such as: Windows Media Player, Core Player... still work properly.
     
  6. agraham

    agraham Expert Licensed User

    Can you display a form with a button or some other controls and does it close without error?

    Are the apps that won't run compiled exes from your old machine?

    Do you have any old compiled apps that run correctly?

    Do all the apps that do not work rely upon any of the component dlls such as formlib?
     
  7. conf

    conf Member

    Hi Agraham, I answer your questions here:

    1. Can you display a form with a button or some other controls and does it close without error?
    - Yes, I have some B4P apps with forms, controls run properly.

    2. Are the apps that won't run compiled exes from your old machine?
    - No, all my complied apps run properly on my old device.

    3. Do you have any old compiled apps that run correctly?
    - Yes, my complied apps run properly (it's without "sound function")

    4. Do all the apps that do not work rely upon any of the component dlls such as formlib?
    - No, my complied apps use library (http.dll, hardware.dll ...) work properly.

    I know surely that problem relate to "sound function" (sorry, I don't know how to call it).
     
  8. agraham

    agraham Expert Licensed User

    Sorry but I am a bit confused. You originally posted
    Yet in the answers to my questions you say
    So I am not sure what your problem is. Your device (nice!) supports the Compact Framework 2 and so should run B4PPC without problems. Are you now saying that the only problem that you have is with sounds?

    I do have a small problem on my Axim X30 with sound. Very short sounds like "tick.wav" are not heard, either from B4PPC sound("tick.wav") or when I tap on them in File explorer but longer sounds such as "tada.wav" play fine. Is your problem similar?
     
  9. conf

    conf Member

    Hi Agraham,

    I have 2 problems:
    1. My old complied app run properly but when I close, it got an error. Because it still run, so I "ignore" the problem.

    2. Another important app run also but not properly. I attach the source code here.
    This is an app will talk you the life percent of battery (in Vietnamese only). It use Text-To-Speech lib and dzHW lib to work.

    Please run this code on your device (not desktop). If you can run and hear the voice => I have big trouble.

    Ps: Thank for your help so much.
     
  10. agraham

    agraham Expert Licensed User

    The pre-compiled "pm.exe" ran and terminated with no error on my Axim X30 but produced no sound.

    I recompiled your source code on my desktop as "pm2.exe", ran that on the desktop and it ran and terminated with no error on my Axim X30 but produced no sound.

    I transferred the source code to my Axim and ran it under Basic4PPC and it ran and terminated with no error and it talked to me!

    I don't understand why the desktop compiled version doesn't work but the device does. I'll play a bit more and post anything that I find out.

    EDIT: Second paragraph is wrong. I did not "ran that on the desktop" I should have typed "copied that to the device" - Apologies
     
    Last edited: Jul 9, 2007
  11. conf

    conf Member

    I'm waiting for your good news. Thank you.
     
  12. dzt

    dzt Active Member Licensed User

    Just a thought.

    TTC_WCE.DLL is a native DLL (unmanaged code).
    .NETCF DLLs are platform independent but Native DLLs are processor dependent.

    Conf, Is your DLL compiled for your processor?

    For me (I've tested it in a machine with ARM920T) your app does not produce errors but on the other hand, I didn't hear anything.
     
  13. conf

    conf Member

    Yes, I thought like you. Maybe the TTS_WCE.DLL can't work with Samsung CPU.

    Can someone have PDA that use Samsung CPU test this code, please?
     
  14. agraham

    agraham Expert Licensed User

    As I mentioned in my last post both conf's pm.exe and my desktop compiled versions didn't produce sound on the device but running the source under Basic4PPPC on the device did.

    I've now got both conf's original pm.exe and my desktop compiled exes making sound. I won't go through the permutations that I tried but it seems to be a Compact Framework versioning problem but (unusually he said modestly!) one that I don't understand. The following steps shouldn't be necessary, and indeed are only necessary if you have CF2.0 on your device as I have and conf will also have. However my device is unusual in that it also has CF1.0 installed so this may not work for everyone with CF2.0 - worth a try though.

    You need Erels' .NET config files - reposted below. Take the device Basic4ppc.exe.config and put two copies in the device directory with pm.exe, TTSwrapper.dll and TTS_WCE.dll. Rename one copy to pm.exe.config and the other to TTSwrappper.dll.config. This will force the program and the dll to load under CF2.0. With a bit of luck things will now work - did for me anyway.

    I would be surpprised if there is any problem with the CPU. Microsoft has strict guidlines for Pocket PC designers so I don't think it could run WM5.0 and be marketed as a Windows Mobile device without being entirely compatible with other Pocket PCs.
     
  15. agraham

    agraham Expert Licensed User

    Update!

    I hadn't exhausted all the permutations before I posted - I was just happy to get it to work. Thinking about it I realised that if the main exe is running under CF2.0 then so will the dll therefore the dll config is totally unnecessary and is probably ignored anyway.

    And it is unnecesary as I've just deleted it and I still get sound from conf's original pm.exe as long as the pm.exe.config file is present.

    I just don't understand why a CF1.0 compiled exe loading a CF1.0 dll loading an unmanaged code dll needs to run under CF2.0 on a machine that has both CF1.0 and CF2.0 on it. (B4PPC exes are effectively CF1.0 exes even if compiled under CF2.0 as their runtime is precompiled CF1.0 code)

    I think the problem must somehow lie in the access to the unmanaged code dll because if the managed dll assembly failed to load then B4PPC would show an error whereas there is no mechanism to send an error to B4PPC if the unmanaged dll failed to load.

    EDIT: For completeness I will mention that the clue that put me on the track of the config problem is that it worked when I ran the source on the device. This is because I run Basic4PPC under CF2.0 on the device using a config file. If I temporarily remove the Basic4PPC.exe.config file I get no sound when I run the source code on the device.
     
    Last edited: Jul 10, 2007
  16. conf

    conf Member

    Thank Agraham so much. You're very kind when work hard for my trouble :D

    My app run well on my old device without config file and CF.Net 2. Yesterday, I upgrade my new device from WM5 to WM6 and everything run well !!!

    I don't know what's happening but I'm happy because it run.

    Thank you all of you again and again :D
     
Loading...