?
Solved

using NetUserEnum in an MFC app.

Posted on 2001-08-19
2
Medium Priority
?
527 Views
Last Modified: 2013-11-20
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?
0
Comment
Question by:jose_garrido
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
NickRepin earned 800 total points
ID: 6405245
In the FileView pane highlight "Rights files" (the top of the tree).

Go to the main menu,  Project->Settings.

Select the Link tab.

Add to the Object/Library Modules edit box: netapi32.lib

Click Ok.
0
 

Author Comment

by:jose_garrido
ID: 6414408
Thank you.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question