Hi,

I'm working on Pocket PC 2002 and have an application which is displaying a
message : "Out of memory".
That's the os which is displaying this message.

I want just to know if someone has an idea of that problem ?
I think that the problem comes from a procedure in the program : the
application is calling every second a dll which in order to display the life
time percent of battery.

Thanks for any information about that problem.

Re: Problem out of memory by Chris

Chris
Mon Jul 18 09:16:06 CDT 2005

The problem is likely that the device is running out of memory, just like it
says. If you have something happening periodically (like you suggest) then
it's definitely a candidate for the leak, but without you posting your code,
we can't very well diagnose the bug.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Gandalf" <Gandalf@discussions.microsoft.com> wrote in message
news:CC9556C2-947D-4DC8-AEB3-294727CE54D0@microsoft.com...
> Hi,
>
> I'm working on Pocket PC 2002 and have an application which is displaying
> a
> message : "Out of memory".
> That's the os which is displaying this message.
>
> I want just to know if someone has an idea of that problem ?
> I think that the problem comes from a procedure in the program : the
> application is calling every second a dll which in order to display the
> life
> time percent of battery.
>
> Thanks for any information about that problem.
>
>



Re: Problem out of memory by Ingo

Ingo
Mon Jul 18 09:22:25 CDT 2005

Gandalf schrieb:
> Hi,
>
> I'm working on Pocket PC 2002 and have an application which is displaying a
> message : "Out of memory".
> That's the os which is displaying this message.
>
> I want just to know if someone has an idea of that problem ?
> I think that the problem comes from a procedure in the program : the
> application is calling every second a dll which in order to display the life
> time percent of battery.
>
> Thanks for any information about that problem.

Do you have a Toshiba e740? This seems to be a common problem for this
model. I get these error messages quite often. In my case the only
solution is to close all other programs.

Ingo

Re: Problem out of memory by Gandalf

Gandalf
Tue Jul 19 08:39:04 CDT 2005

Hi,

First one, I'm using an Intermec 760 Color PDA.

Concering the code, I can only show you the code of the dll which is written
in C++.
In fact, the other part of code is generated by an AGL and it's not easy to
show you that code.

The main program is calling a dll every 20 seconds. The code is the
following :
----------------------------------------------------------------------------------------------
#include "stdafx.h"
#include "Winbase.h"
#include "tchar.h"
#pragma comment(lib, "coredll.lib")

TCHAR a_szSUC[] = _T("1");
TCHAR a_szERR[] = _T("0");

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;
}

int GetInfosBatt()
{
SYSTEM_POWER_STATUS_EX powerStatusEx;
int nBattValue = 0;

BOOL fRet = GetSystemPowerStatusEx(&powerStatusEx, true);
if(fRet)
{
nBattValue = powerStatusEx.BatteryLifePercent;
return nBattValue;
}
return -1;
}

int GetFlagBatt()
{
SYSTEM_POWER_STATUS_EX powerStatusEx1;
int nFlagBatt = 0;

BOOL fRet = GetSystemPowerStatusEx(&powerStatusEx1, true);
if(fRet)
{
nFlagBatt = powerStatusEx1.BatteryFlag;
return nFlagBatt;
}
return -1;
}

extern "C" void GetBattInfos(TCHAR** pData)
{
int flagVal = 0;
int flagBatt = 0;
LPTSTR str1 = _T("");
LPTSTR str2 = _T("");
char buffer1[3];
char buffer2[3];

flagVal = GetInfosBatt();
flagBatt = GetFlagBatt();

if(flagVal != -1 && flagBatt != -1)
{
pData[2] = a_szSUC;
}
else
pData[2] = a_szERR;

_itoa(flagVal, buffer1, 10);
int size1 = MultiByteToWideChar(CP_ACP, 0, buffer1, -1, NULL, 0);
MultiByteToWideChar(CP_ACP, 0, buffer1, -1, str1, size1);
pData[0] = str1;

_itoa(flagBatt, buffer2, 10);
int size2 = MultiByteToWideChar(CP_ACP, 0, buffer2, -1, NULL, 0);
MultiByteToWideChar(CP_ACP, 0, buffer2, -1, str2, size2);
pData[1] = str2;
}
-----------------------------------------------------------------------------------------------

So I'm using an "execute" function every 20 seconds. That function is
calling the "GetBattInfos" external function every 20 seconds, but what does
that function ? Is the dll loaded in memory every time ?

Thanks for any information.

"Ingo Schulz" wrote:

> Gandalf schrieb:
> > Hi,
> >
> > I'm working on Pocket PC 2002 and have an application which is displaying a
> > message : "Out of memory".
> > That's the os which is displaying this message.
> >
> > I want just to know if someone has an idea of that problem ?
> > I think that the problem comes from a procedure in the program : the
> > application is calling every second a dll which in order to display the life
> > time percent of battery.
> >
> > Thanks for any information about that problem.
>
> Do you have a Toshiba e740? This seems to be a common problem for this
> model. I get these error messages quite often. In my case the only
> solution is to close all other programs.
>
> Ingo
>