473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

EnumWindows for WinCE 4.20

Hello!

I am trying to get a list of all the process running on WinCE. I first
developed my code on NT (which is working fine) and now I am porting it to
WinCE 4.20. I am using embedded Visual C++ 4 SP2.

My problem is that the callback function is called only once and my program
crashes. No exception seems to be thrown. Do you have some suggestions on
what may be the problem?

My code looks like:

BOOL CALLBACK _EnumProc(HWND hwnd, LPARAM lParam);

void DrvOpen(void)
{
BOOL bFoundProc = FALSE;
...
EnumWindows(_EnumProc, (unsigned long)&bFoundProc);
...
}

BOOL CALLBACK _EnumProc(HWND hwnd, LPARAM lParam)
{
BOOL bContinueEnum = TRUE;

TCHAR pszCaption[2048];
char szProcName[2048];
static unsigned int uiCallCounter = 0;

GetWindowText(hwnd, pszCaption, sizeof(pszCaption));

wtoa( pszCaption, szProcName, 2048 );
_TraceLog( szProcName, FALSE, FALSE ); // bCheckLastError, bOverwriteFile

....

return bContinueEnum;
}

Thank you in advance!

Frederic.
Nov 17 '05 #1
1 2254
>My problem is that the callback function is called only once and my program
crashes. No exception seems to be thrown. Do you have some suggestions on
what may be the problem?
Frederic,

A shot in the dark...

Is the stack allocation large for a CE device perhaps?
TCHAR pszCaption[2048];
char szProcName[2048];
This:
GetWindowText(hwnd, pszCaption, sizeof(pszCaption));


ought to be:

GetWindowText(hwnd, pszCaption, 2048/*_countof(pszCaption)*/);

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: //\\//\\RLe | last post by:
We are testing one of the CASIO hand device on WinCE and wireless module... while trying to run any Oracle Forms in web browser found that we need JavaInitiator for WinCE and... can't find any on...
5
by: Sean Dudley | last post by:
I am currently enumerating windows via the EnumWindows API. I noticed that for some reason the very first time I call my enumwindows routine (inside or outside of a thread) it seems to be very...
11
by: Wayne | last post by:
I have some code written in delphi that uses EnumWindows, I would like to begin to translate this code to C#. Is there a built in EnumWindows call in Csharp? or do I have to import the API and use...
1
by: Beyers | last post by:
Hi We are using active sync to connect VS.NET to a WinCE hardware platform for debuggging the application we are writing for this platform. It worked well for a month, and now all of a sudden...
2
by: parth_mca | last post by:
i want to start WinCE programming in vb.net... which version of visual studio.net supports winCE programming for PocketPC ? and where should i start from...?
2
by: bokiteam | last post by:
Hi All, I am developing a WinCE project, when I include datagrid, it says no define.. could you please advice? it works on Win32 project by the same code... Thank you very much for you...
3
by: pcm | last post by:
Hi, Has anyone ever worked on a Python-WinCE-based program that involved serial port management ? Regards, Philippe
1
by: TheSebaster | last post by:
I wrote the following lines of code under Microsoft Visual Studio 2005: I compile my WinCE c++ application importing MyInterop.tlb generated file. The MyInterop.tlh generated file do not contain my...
1
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I've a question regarding the Win32 function EnumWindows. First, the prototype for EnumWindows is as follows... BOOL EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam) ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.