在WIN2000下建立共享目录的问题

coolmei25 2005-02-22 10:26:35
我抄袭了http://search.csdn.net/Expert/topic/826/826600.xml?temp=.96719 中: hearttree(无心树) 的例子,把他的改成了如下形式:
UpdateData();


SHARE_INFO_502 si502;
NET_API_STATUS nas;
SECURITY_DESCRIPTOR sd;

if(!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
return;

si502.shi502_netname = TEXT("Hello");
si502.shi502_type = STYPE_DISKTREE;
si502.shi502_remark = NULL;
si502.shi502_permissions = 0;
si502.shi502_max_uses = SHI_USES_UNLIMITED;
si502.shi502_current_uses = 0;
si502.shi502_path = TEXT("D\\:");
si502.shi502_passwd = NULL;
si502.shi502_reserved = 0;
si502.shi502_security_descriptor = &sd;

nas = NetShareAdd(
NULL, // share is on local machine
502, // info-level
(LPBYTE)&si502, // info-buffer
NULL // don't bother with parm
);
if(nas != NO_ERROR)
{
AfxMessageBox("´´½¨¹²ÏíĿ¼ʧ°Ü£¡");
CDialog::OnCancel();
}
else
{
// SHChangeNotify(SHCNE_NETSHARE, SHCNF_PATH, (LPCVOID)szShareDir, NULL);
}


可是在编译的时候提示:
Linking...
ShareDirDlg.obj : error LNK2001: unresolved external symbol _NetShareAdd@16
Debug/ShareDir.exe : fatal error LNK1120: 1 unresolved externals

请问是什么问题呢?
...全文
109 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
bohut 2005-02-22
  • 打赏
  • 举报
回复
project->setting->link属性页 :

object/library module 栏加入

Netapi32.lib

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧