0

I wanna use STL Map with struct

I wanna find process name,PPID,PID,path with CreateToolhelp32Snapshot and save these things in this struct ProcessMap.

and after 0.5 secs, search those Process things again and compare struct for update. Please Help me..

for example

typedef struct ProcessMap
{
    boolean Survival;
    CString FileName;
    int PPID;
    int PID;
    CString Path;
};

Is it right that use like this? (The Key is PID)

map<ProcessMap, int>Pmap;

map<ProcessMap, int>::iterator it;

Thanks for read this.

songyuanyao
  • 169,198
  • 16
  • 310
  • 405
Kaen2891
  • 1
  • 4
  • if PID is the key, then i think map should be declared like this: map Pmap – facebook-100001358991487 Oct 17 '16 at 07:31
  • than how can I push things into "Pmap"? for example) Survival = FALSE; FileName = (LPCTSTR)pe32.szExeFile; PPID = pe32.th32ParentProcessID; PID = pe32.th32ProcessID; etc.... how can I fill? mymap.insert(PPID,FALSE,pe32.szExefile... ) like this? – Kaen2891 Oct 17 '16 at 08:34

0 Answers0