Link to home
Start Free TrialLog in
Avatar of jose_garrido
jose_garrido

asked on

using NetUserEnum in an MFC app.

Hello

I'm having problems using "NetUserEnum"

The project is an MFC application (exe), a dialog box.
The only thing I added was a button and this code:

#include <lmaccess.h>
...
...
void CRightsDlg::OnButtonFind()
{
  LPUSER_INFO_0 pBuf = NULL;
  DWORD dw_entriesread=0;
  DWORD dw_totalentries=0;
  DWORD dwResumeHandle = 0;
  NetUserEnum(NULL,0,FILTER_NORMAL_ACCOUNT,(LPBYTE*)
    &pBuf,MAX_PREFERRED_LENGTH,&dw_entriesread,
    &dw_totalentries,&dwResumeHandle);
}

When I try to built the project, I received this message.

----Configuration: Rights - Win32 Debug---

Linking...
RightsDlg.obj : error LNK2001: unresolved external symbol
_NetUserEnum@32
Debug/Rights.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Rights.exe - 2 error(s), 0 warning(s)

Could you help me?
ASKER CERTIFIED SOLUTION
Avatar of NickRepin
NickRepin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jose_garrido
jose_garrido

ASKER

Thank you.