"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:e4AMJvCPFHA.3908@TK2MSFTNGP10.phx.gbl...
> If the function you are P/Invoking has a direct managed equivalent then of
> course you should use that instead, but especially with the Compact
> Framework there are times when you need to use P/Invoke because the
> functionality is not included in the standard class libraries.Do not
> forget that at some point all of the managed classes are calling down to
> the underlying OS for their functionality.
> There are a couple of possible reasons why your app may die under
> continuous P/Invoking, perhaps your P/Invoke definitions are wrong,
> perhaps you are not correctly handling an error condition, or perhaps you
> are not correctly allocating or freeing native memory. If you can pinpoint
> a specific function then post your P/Invoke declaration and code snippet
> of it in use and we can advise further.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
>
http://www.inthehand.com |
http://blog.opennetcf.org/pfoot/ >
> "McFar" <_NO_NO__REMOVE_@6784.com> wrote in message
> news:eFxIUlCPFHA.3292@TK2MSFTNGP12.phx.gbl...
>>I am not sure that exception handling will help here....
>> I posted an example of simple application here a couple of weeks ago,
>> that
>> does nothing just PInvokes huge number of times in a row
>> and the application just disappeared, none exception, none message, just
>> disappeared....
>> So I supposed that it is a PInvoke problem and replaced all the PInvoke
>> calls onto managed
>> functions, the application works fine now...
>>
>> "<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
>> news:OQAK9PCPFHA.2736@TK2MSFTNGP09.phx.gbl...
>>> Or use exception handling. There's no reason top avoid P/Invokes just
>>> becasue you fear them.
>>>
>>> -Chris
>>>
>>>
>>>
>>> "McFar" <_NO_NO__REMOVE_@6784.com> wrote in message
>>> news:uStfM$APFHA.2468@tk2msftngp13.phx.gbl...
>>> > Hello, I have the same problem and found a ay to fix it, in my
>> application
>>> > it was because of
>>> > PInvoke to native functions. :)
>>> >
>>> > Does your application PInvoke to native functions? If does, so try to
>> find
>>> > out another solution to avoid PInvoke
>>> >
>>> >
>>> > "KNC" <khanh@glassegg.com> wrote in message
>>> > news:1112941264.015260.288950@f14g2000cwb.googlegroups.com...
>>> >> hi all,
>>> >>
>>> >> Our app got a long-term headache bug, that is our App sometimes
>>> >> quit
>>> >> unexpectedly without any warning. We heard that if installing SP3,
>>> >> everything is OK. But that's not true. Even installing SP3, our app
>>> >> still quit.
>>> >> We use a tool for automatically test 1 event load form, and write
>>> >> to
>>> >> log file to check in detail. The test report is as follows:
>>> >>
>>> >> 1) Hardware
>>> >> PDA Client machine: Pocket Loox/ FLX3AW
>>> >> CPU: Intel PXA 255 400MHz
>>> >> Memory: RAM 128M and ROM 64 M
>>> >> OS: Window Mobile 2003 software for Pocket PC
>>> >> Database: MS SQL CE
>>> >>
>>> >> 2) Software
>>> >> Test: Pocket PC Controller Professional Version 4.12
>>> >> Delopement: VB.NET compact framework
>>> >>
>>> >> 3) Metrics
>>> >> Total number tests: 250
>>> >> Total number of quiting unexpectedly: 18
>>> >> Test place: event load form of a specific form
>>> >>
>>> >> 4) Average Memory(GlobalStatusMemory API function)
>>> >>
>>> >> MemoryLoad: 46
>>> >> TotalPhysical: 51.859375
>>> >> AvailablePhysical: 28.21875
>>> >> TotalPageFile: 0
>>> >> AvailPageFile: 0
>>> >> TotalVirtual: 32
>>> >> AvailVirtual: 22.4375
>>> >>
>>> >>
>>> >> 5) Result
>>> >> It quit in any place in load form event, even at the end of
>>> >> function Load_Form
>>> >>
>>> >> We think of 4 capabilities:
>>> >>
>>> >> - Our App has a serious bug ?
>>> >> - Memory isn't enough ?
>>> >> - Window Mobile 2003 has a problem ?
>>> >> - Pocket PC Fujitsu device has a problem
>>> >>
>>> >>
>>> >> Any help to light up for us?
>>> >> Thanks,
>>> >> KNC
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>
>