在WIN2000下建立共享目录的问题
我抄袭了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
请问是什么问题呢?