[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

using NetUserEnum in an MFC app.

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

649 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