Open the project directly with EVC 4, and the following error occurs in bulid:
-------------------- Configuration: listprocess-Win32 (wce emulator) debug --------------------
Linking...
Listprocessdlg. OBJ: Error lnk2019: unresolved external symbol _ process32next referenced in function "protected:
Void _ thiscall clistprocessdlg: onbutton1 (void )"(? Onbutton1 @ clistprocessdlg @ iaexxz)
Listprocessdlg. OBJ: Error lnk2019: unresolved external symbol _ process32first referenced in function "protected:
Void _ thiscall clistprocessdlg: onbutton1 (void )"(? Onbutton1 @ clistprocessdlg @ iaexxz)
Listprocessdlg. OBJ: Error lnk2019: unresolved external symbol _ createconlhelp32snapshot referenced in Function
"Protected: void _ thiscall clistprocessdlg: onbutton1 (void )"(? Onbutton1 @ clistprocessdlg @ iaexxz)
Emulatordbg/listprocess.exe: Fatal error lnk1120: 3 unresolved externals
Error executing link.exe.
However, if the files are compiled one by one, there is no error
Fortunately, this error is experienced-the library file corresponding to the above functions is missing
I have also read p130 in "EVC advanced programming and application development" and mentioned this library file toolhelp. Lib.
Therefore, you only need to add project settings --> link --> Object/library modules under ide:
Toolhelp. Lib
Done!
In addition, you must add the following statement in the stdafx. h file, if not:
# Include <tlhelp32.h>
Note: This is not necessary. I only made the above changes in the IDE, and there is no problem in running it.
Build, the figure after running by button1 is as follows:
The strange thing is why the book did not mention such important details.