请教share_info_50这个结构在那个头文件中定义
l6jj 2000-04-28 10:19:00 int nLevel = 50;
struct share_info_50* pBuf ;
unsigned short cbBuffer;
NET_API_STATUS nStatus;
cbBuffer = sizeof(struct share_info_50);
pBuf = malloc(cbBuffer);
if (pBuf == NULL)
strcpy(pBuf->shi50_netname, Edit1->Text.c_str());
pBuf->shi50_type = STYPE_DISKTREE;
pBuf->shi50_flags = SHI50F_FULL;
pBuf->shi50_remark = NULL;
strcpy(pBuf->shi50_path,Edit2->Text.c_str());
pBuf->shi50_rw_password[0] = '\0'; // No password
pBuf->shi50_ro_password[0] = '\0'; // No password
//
// Call the NetShareAdd function
// specifying information level 50.
//
nStatus = NetShareAdd(NULL,
nLevel,
(char FAR *)pBuf,
cbBuffer);
//
// Display the result of the function call.
//
if (nStatus == NERR_Success)
ShowMessage("Share added successfully\n");
else
ShowMessage("Error");
//
// Free the allocated memory.
//
if (pBuf != NULL)
free(pBuf);