Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

using NetUserEnum in an MFC app.

Posted on 2001-08-19
2
Medium Priority
?
529 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month20 days, 15 hours left to enroll

810 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