Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROCESSENTRY32 undeclared identifier

Status
Not open for further replies.

TheMillionDollarMan

Programmer
Jun 10, 2002
132
0
0
US

Hi.

I am trying to build a console app that takes a snap shot of the current running processes and saves the info to a file.

However I get this complier error:
PROCESSENTRY32: undeclared identifier

It can be found in the header Tlhelp32.h.
I read the help for error code C2065 but it didn't help.

Can someone explain to me how I can resolve this error message?

Thanks
D
 
Did you actually try to include that file and windows.h? ;)
All ToolHelp functions are already in kernel32.dll, so there shouldn't be any problem...
 

Yeah. I have these three includes..
#include <Winbase.h>
#include <Tlhelp32.h>
#include <stdafx.h>

I also tried
#include <windows.h>
#include <Tlhelp32.h>
#include <stdafx.h>

No avail.

It should be noted that when
PROCESSENTRY32 pEntry;
When I am coding hitting the full stop next to pEntry gives a list of all the members in this struct so it can find the definition but just not at compile time.

hmmm...

A compilation directive maybe...I have tried a few already.
 
I've just tried it, and it works, so something with your compiler settings are maybe different...
Btw, is there any special stdafx.h...? Why do you need it in console app...?
 
put in this order:

#include &quot;stdafx.h&quot;
#undef _WINDOWS_
#include<windows.h>

Ion Filipski
1c.bmp
 
Try putting a

#define _WINNT_WIN32 0x500

before the other includes. This makes your program incompatible with Win95/98/NT 4.0 but exposes newly introduced APIs in Win2K. If this works, then this is the way to do it.

Cheers,
Andy
 
Thanks for the suggestions guys but niether worked.

What did work...

#include <windows.h>
#include <Tlhelp32.h>
#include <stdio.h>

case closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top