0
votes

I Have an MFC Dialog application. I use win7 service pack 1 32 bit, Visual Studio 2010, MFC 2008/2010. This is a part of my dlg file

//getprocessDlg.cpp
        #include <psapi.h>
        // TODO: Add extra initialization here
    DWORD aProcesses[1024], cbNeeded, cProcesses;
    unsigned int i;

    if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
    {
        return 1;
    }

When i Run, it display error. That's it

Error 1 error LNK2019: unresolved external symbol _EnumProcesses@12 referenced in function "protected: virtual int __thiscall CgetprocessDlg::OnInitDialog(void)" (?OnInitDialog@CgetprocessDlg@@MAEHXZ) c:\Users\AnhNT\documents\visual studio 2010\Projects\getprocess\getprocess\getprocessDlg.obj getprocess

Error 2 error LNK2019: unresolved external symbol _GetModuleBaseNameW@16 referenced in function "public: void __thiscall CgetprocessDlg::PrintMemoryInfo(unsigned long)" (?PrintMemoryInfo@CgetprocessDlg@@QAEXK@Z) c:\Users\AnhNT\documents\visual studio 2010\Projects\getprocess\getprocess\getprocessDlg.obj getprocess

I try all day but it has not work. Can somebody help me :(

1
You need to edit your linker settings to include psapi.lib.Captain Obvlious
thanks :D. I will remark them to forward :Dlex_luther_9x

1 Answers

2
votes

Add Psapi.lib to the list of linker dependencies.

Project - Properties - Configuration Properties - Linker - Input - Additional Dependencies. Type Psapi.lib there.