You should define a MODULEENTRY32 object instead of your "modentry32 mod32"
Luckily, I'm writing a task manager project. So I recommend you use regular definition type instead of 'pointer'. (Your definition may cause 100% crash, for certain)
I have no idea what im doing here to be honest, i understand what a struct is and i understand the data that is inside of it but i have no idea why i need...
why is "tag" here in the struct name? typedefstructtagMODULEENTRY32
"typedef struct" something left over from C i read? typedefstruct
This looks like its just 2 separate objects of the same struct?
The Microsoft definition is just to make the use of the structre more C friendly.
as you know, in C you can't use just the name of a struct
1 2 3 4 5 6 7 8 9
struct Example
{
int one;
int two;
int three;
};
Example ex; // ERROR
struct Example ex; // OK
to get round this, a typedef is provided. You're supposed to use the typedef name rather than the struct name, to avoid having to type struct all over the place.
The name of the struct has "tag" prefixed to it so there is no name collision, but that it's obiously the struct definition used for the typedef.
PMODULEENTRY32 and LPMODULEENTRY32 are identical. The L version is a hangover from the olden (Win16) days when there were near and far pointers.