Solved

using NetUserEnum in an MFC app.

Posted on 2001-08-19
2
509 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 200 total points
Comment Utility
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
Comment Utility
Thank you.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now