|
|
Comments and Discussions
|
|
 |

|
David: From your screenshots i see JYOUNG listed at different places. My question is: How can i differentiate that JYOUNG is using File-A on Computer-A (vs) JYOUNG is using File-B on Computer-B. Any insights in how to solve this will be helpful.
pavanchand
|
|
|
|

|
You're example compares two different computers: Computer-A and Computer-B. My screenshot was for one computer.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|

|
David: I was trying to use your screenshot to ask my question. I wasnt contridicting what you wrote. Here is my question a little in detail.
Say JYOUNG has an account in Domain1 and Domain2. Say on Computer-A he is logged in with DOMAIN1\\JYOUNG and opens a File-A and on Computer-B he is logged in with DOMAIN2\\JYOUNG and opens File-B.
How can i differentiate between DOMAIN1 access (VS) DOMAIN2 access. Since NetFileEnum cals only returns JYOUNG.
pavanchand
|
|
|
|

|
pclearn wrote: How can i differentiate between DOMAIN1 access (VS) DOMAIN2 access. Since NetFileEnum cals only returns JYOUNG.
I do not know. Good question, though.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|

|
When I attempt to build the sample solution in Visual Studio 2008, I receive the following errors,
Error 1 Command line error D8030 : INTERNAL COMPILER ERROR in '' cl NetDemo
Error 2 error BK1506 : cannot open file '.\Debug\NetDemoDlg.sbr': No such file or directory BSCMAKE NetDemo
Do you have any suggestions?
TIA,
Roger
modified on Friday, October 16, 2009 7:01 PM
|
|
|
|

|
Please note that I have added the following directory to the list of library directories so that it will include the Netapi32.lib file when building,
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
What else am I missing?
|
|
|
|

|
john_1726 wrote: Error 1 Command line error D8030 : INTERNAL COMPILER ERROR in '' cl NetDemo
D8030
john_1726 wrote: Error 2 error BK1506 : cannot open file '.\Debug\NetDemoDlg.sbr': No such file or directory BSCMAKE NetDemo
BK1506
I have not tried compiling this with anything other than VS6. Other than Unicode issues, I know of no reason why it would not compile. You could always create a new VS2008 project and copy the CPP/H files from this article.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|

|
DavidCrow wrote: I have not tried compiling this with anything other than VS6.
Is there anywhere I can download a Microsoft Visual Studio 6 Express edition for C++?
modified on Monday, October 19, 2009 11:35 AM
|
|
|
|

|
I don't know, but you can get VS2008 Express. It does not support MFC, though.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|

|
john_1726 wrote: Is there anywhere I can download a Microsoft Visual Studio 6 Express edition for C++?
David, please disregard my previous message--my boss still has the old Visual Studio CDs.
Really appreciate your help--thanks for creating these tools!
modified on Monday, October 19, 2009 11:35 AM
|
|
|
|

|
David,
When I create an empty C++ project and add the *.h and *.cpp files to the project, the build gives me the following error message,
Error 1 fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h 24 NetDemoProject
If I define _AFXDLL in the stdafx.h file, I then receive this error message,
Error 2 fatal error LNK1561: entry point must be defined NetDemoProject NetDemoProject
Do you have any suggestions? Here is an article related to the _AFXDLL error message that I researched, but I didn't create the project using an AppWizard--I just created an empty project,
http://support.microsoft.com/kb/140597[^]
Any suggestions you may have would be greatly appreciated. FYI, we are using Visual Studio 2008 Professional Edition.
|
|
|
|

|
john_1726 wrote: When I create an empty C++ project...
What kind of project did you opt for?
john_1726 wrote: Error 1 fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h 24 NetDemoProject
See here.
john_1726 wrote: ...but I didn't create the project using an AppWizard--I just created an empty project...
That may be the problem. Certain compiler/linker switches must be in place for MFC to work properly.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|

|
DavidCrow wrote: john_1726 wrote:
...but I didn't create the project using an AppWizard--I just created an empty project...
That may be the problem. Certain compiler/linker switches must be in place for MFC to work properly.
When I try to create a new MFC Application, I then remove the files it generated and put the *.h/*.cpp files from your project into the the project I've created, I receive the following error message,
Error 1 error LNK2019: unresolved external symbol _NetApiBufferFree@4 referenced in function "protected: void __thiscall CPage1::OnBtnGo(void)" (?OnBtnGo@CPage1@@IAEXXZ) Page1.obj NetDemoProject
Error 2 error LNK2001: unresolved external symbol _NetApiBufferFree@4 Page2.obj NetDemoProject
Error 3 error LNK2019: unresolved external symbol _NetFileEnum@36 referenced in function "protected: void __thiscall CPage1::OnBtnGo(void)" (?OnBtnGo@CPage1@@IAEXXZ) Page1.obj NetDemoProject
Error 4 error LNK2019: unresolved external symbol _NetConnectionEnum@32 referenced in function "protected: void __thiscall CPage2::OnBtnGo(void)" (?OnBtnGo@CPage2@@IAEXXZ) Page2.obj NetDemoProject
Error 5 error LNK2019: unresolved external symbol _NetShareEnum@28 referenced in function "protected: void __thiscall CPage2::OnBtnGo(void)" (?OnBtnGo@CPage2@@IAEXXZ) Page2.obj NetDemoProject
Error 6 fatal error LNK1120: 4 unresolved externals C:\Workspace\IT-Support\GarethSlater\FileSystemWatcher\NetDemoProject\Debug\NetDemoProject.exe NetDemoProject
Is there some sort of MFC library that I'm missing? Do I need to add a particular project directory using the Visual Studio options dialog?
|
|
|
|

|
David,
Please note that I took a closer look at your post below "NetFileEnum problem on XP SP1." The code below enabled me to build and run a C# version of the NetFileEnum app, which is what I was looking for. Thanks again!
All the best,
Roger
|
|
|
|

|
Actually, now that I have tested the application more closely, I am having the same problem as intel96 mentioned in a previous message:
intel96 wrote:
I always receive 0 (zero) values for these:
1. dwStatus
2. dwIndex
3. dwReadEntrie
Do you have any suggestions? I found another post of yours about using AdjustTokenPrivileges() that may help with this issue (cf. http://www.codeproject.com/Messages/1646336/NetFileEnum-again.aspx[^]). Could you please explain, how would I use that?
TIA,
Roger
|
|
|
|

|
If the functions are returning 0, that equates to NERR_Success. If they were returning ERROR_ACCESS_DENIED instead, then you might look into using AdjustTokenPrivileges().
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|

|
OK, it is returning NERR_Success, but the dwReadEntries is also always zero. Therefore, the function call is not returning any information about any open files on the computer. Here is the entire source code,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace NetDemoCSharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCheck_Click(object sender, EventArgs e)
{
CheckForOpenFiles();
}
#region NetFile
public void CheckForOpenFiles()
{
try
{
const int MAX_PREFERRED_LENGTH = -1;
int dwReadEntries;
int dwTotalEntries;
IntPtr pBuffer = IntPtr.Zero;
FILE_INFO_3 pCurrent = new FILE_INFO_3();
//string servername = @"\\ntitcal01";
string servername = "192.168.10.121";
int dwStatus = NetFileEnum(servername, @"c:\", Environment.UserName, 3, ref pBuffer, MAX_PREFERRED_LENGTH, out dwReadEntries, out dwTotalEntries, IntPtr.Zero);
if (dwStatus == 0)
{
for (int dwIndex = 0; dwIndex < dwReadEntries; dwIndex++)
{
IntPtr iPtr = new IntPtr(pBuffer.ToInt32() + (dwIndex * Marshal.SizeOf(pCurrent)));
pCurrent = (FILE_INFO_3)Marshal.PtrToStructure(iPtr, typeof(FILE_INFO_3));
listBox1.Items.Add(dwIndex + " " +
pCurrent.fi3_id + " " +
pCurrent.fi3_num_locks + " " +
pCurrent.fi3_pathname + " " +
pCurrent.fi3_permission + " " +
pCurrent.fi3_username);
}
NetApiBufferFree(pBuffer);
}
}
catch (Exception exGen)
{
MessageBox.Show(exGen.ToString());
}
finally
{
MessageBox.Show("Testing Finished");
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
struct FILE_INFO_3
{
public int fi3_id;
public int fi3_permission;
public int fi3_num_locks;
[MarshalAs(UnmanagedType.LPWStr)]
public string fi3_pathname;
[MarshalAs(UnmanagedType.LPWStr)]
public string fi3_username;
}
[DllImport("netapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
static extern int NetFileEnum(
string servername,
string basepath,
string username,
int level,
ref IntPtr bufptr,
int prefmaxlen,
out int entriesread,
out int totalentries,
IntPtr resume_handle
);
//TODO: implement to adjust privileges so that application can view open processes (cf. )
//[DllImport("Advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
//static extern int AdjustTokenPrivileges(
//IntPtr token_handle,
//bool disable_all_privileges,
//string username,
//int level,
//ref IntPtr bufptr,
//int prefmaxlen,
//out int entriesread,
//out int totalentries,
//IntPtr resume_handle
//);
[DllImport("Netapi32.dll", SetLastError = true)]
static extern int NetApiBufferFree(IntPtr Buffer);
#endregion
}
}
Do you have any suggestions?
TIA.
|
|
|
|

|
john_1726 wrote: Do you have any suggestions?
This is not unmanaged C++. Perhaps a more appropriate forum would be of more help.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|

|
Actually, I got it running by monitoring shares on a remote computer--it just doesn't work if you monitor a directory on localhost. BTW, I got your C++ project building and running using Visual Studio 2010 Ultimate!
|
|
|
|

|
Hi David,
This is really a nice example for the starters. I tried running it on my Windows XP (SP2), but, I could not get any open file list. The NetFileEnum returned 0 (success). After NetFileEnum exited, dwTotalEntries's value is 0. Can you please help in resolving this issue? Enumerating shares worked well.
Thanks again,
Kiran
|
|
|
|

|
kvrnkiran wrote: Can you please help in resolving this issue?
That's kind of hard to do without seeing a relevant code snippet.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|

|
Thank you for the reply. I compiled your code only. Supplied EXE is not working either. Then I tried debugging the code. Could not get any result. Can you please help?
Kiran.
|
|
|
|

|
kvrnkiran wrote: Supplied EXE is not working either.
Keep in mind there is no "XP" at the top of the article.
What does your call to NetFileEnum() look like?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|

|
So, the NetFileEnum is void in XP? I have the code snippet like this (I am using the code you have supplied with no modifications):
File: Page1.cpp
Function: CPage1::OnBtnGo()
dwStatus = NetFileEnum((LPWSTR) ((LPCTSTR) strServer), NULL, NULL, 3, (LPBYTE *) &pBuffer, MAX_PREFERRED_LENGTH, &dwReadEntries, &dwTotalEntries, NULL);
I have given the strServer as the local computer name. Once the above statement executes, dwStatus holds 0 (no error) and dwReadEntries and dwTotalEntries will be 0s. So, it is going to the if condition (if (NERR_Success == dwStatus)) and returns from the for loop with zero iterations.
Hope that helps.
Kiran
|
|
|
|

|
kvrnkiran wrote: So, the NetFileEnum is void in XP?
No, it exists. I just did not test on such a platform.
kvrnkiran wrote: dwStatus = NetFileEnum((LPWSTR) ((LPCTSTR) strServer), NULL, NULL, 3, (LPBYTE *) &pBuffer, MAX_PREFERRED_LENGTH, &dwReadEntries, &dwTotalEntries, NULL);
Use a string literal as the first argument. Does that make a difference?
kvrnkiran wrote: Once the above statement executes, dwStatus holds 0 (no error) and dwReadEntries and dwTotalEntries will be 0s.
So are there any open files on the specified server?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|

|
I have tried your suggestion. I have modified the line like this:
dwStatus = NetFileEnum( strServer.GetBuffer(0), NULL, NULL, 3, (LPBYTE *) &pBuffer, MAX_PREFERRED_LENGTH, &dwReadEntries, &dwTotalEntries, NULL);
Just changed the first argument and tried by giving the system name. Nothing returned. Then I tried with \\192.168.1.1
I got one entry like this:
\PIPE\srvsvc | ADMINISTRATOR | 0 | RWA
Any clue?
Kiran
|
|
|
|

|
Hi,
After a very long study on what is happening, I found the problem. In fact, there was no problem, except, I misunderstood this function. I thought, it returns all opened files on a remote computer. But, I was wrong. It just enumerates all the files used by another computer in the network.
I mean, when I open one file on my sand box: \\MyComputer\SomeExecutable.exe then only this function returns the executable file (and all dlls used by the executable). Actually, I got mis-leaded by Microsoft documentation which says, "It returns information about some or all open files on a server". I was expecting that, this function returns all opened files on the given computer.
Now, I got clarity on this. Thank you very much for your time and support.
Kiran
|
|
|
|

|
Do you have UNICODE and _UNICODE defined?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|

|
Yes. _UNICODE is defined and being used in the project.
|
|
|
|

|
I tried this code on Windows XP SP1 and the NetFileEnum for the localhostname return nothing in the listbox. I also tried the code on a Windows 2000 SP4 workstation and received the same results. On a Windows 2000 SP4 server it worked.
What could be causing this problem?
|
|
|
|

|
intel96 wrote: ...NetFileEnum for the localhostname return nothing in the listbox.
Are you checking its return value?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|

|
I am only testing your netdemo.exe on my Windows XP SP1 system. My coding platform is VS2005 w/.NET 2.0.
When I run the NetFileEnum part of your test app on the local system nothing is displayed in the listbox.
When I tried to put your app in VS2005 it will not compile. These are the errors that I receive:
Error 1 Command line error D8004 : '/D' requires an argument cl
Error 2 error BK1506 : cannot open file '.\Debug\NetDemoDlg.sbr': No such file or directory BSCMAKE
|
|
|
|

|
intel96 wrote: When I run the NetFileEnum part of your test app on the local system nothing is displayed in the listbox.
It's a VS6 project. You need to debug it with such.
intel96 wrote: When I tried to put your app in VS2005 it will not compile. These are the errors that I receive:
Error 1 Command line error D8004 : '/D' requires an argument cl
Error 2 error BK1506 : cannot open file '.\Debug\NetDemoDlg.sbr': No such file or directory BSCMAKE
This looks like a compiler issue. Do you get the same with other VS6 projects that you convert to VS2005?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|

|
I have not convert any projects from VS6 to VS2005. I started .NET coding with VS2003 and only write C# in my project.
I download your project, because it was using NetFileEnum correctly and I wanted to review your output so I can change my C# code to match.
I have been trying the following code in C#, but it fails. I am thinking that NetFileEnum has a problem on Windows XP SP1, but it is too early to tell.
I always receive 0 (zero) values for these:
1. dwStatus
2. dwIndex
3. dwReadEntrie
private void btnCheck_Click(object sender, EventArgs e)
{
CheckForOpenFiles();
}
#region NetFile
public void CheckForOpenFiles()
{
try
{
const int MAX_PREFERRED_LENGTH = -1;
int dwReadEntries;
int dwTotalEntries;
IntPtr pBuffer = IntPtr.Zero;
FILE_INFO_3 pCurrent = new FILE_INFO_3();
string servername = "10.1.1.1";
int dwStatus = NetFileEnum(servername, @"c"\\", Environment.UserName, 3, ref pBuffer, MAX_PREFERRED_LENGTH, out dwReadEntries, out dwTotalEntries, IntPtr.Zero);
if (dwStatus == 0)
{
for (int dwIndex = 0; dwIndex < dwReadEntries; dwIndex++)
{
IntPtr iPtr = new IntPtr(pBuffer.ToInt32() + (dwIndex * Marshal.SizeOf(pCurrent)));
pCurrent = (FILE_INFO_3)Marshal.PtrToStructure(iPtr, typeof(FILE_INFO_3));
listBox1.Items.Add(dwIndex + " " +
pCurrent.fi3_id + " " +
pCurrent.fi3_num_locks + " " +
pCurrent.fi3_pathname + " " +
pCurrent.fi3_permission + " " +
pCurrent.fi3_username);
}
NetApiBufferFree(pBuffer);
}
}
catch (Exception exGen)
{
MessageBox.Show(exGen.ToString());
}
finally
{
MessageBox.Show("Testing Finished");
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
struct FILE_INFO_3
{
public int fi3_id;
public int fi3_permission;
public int fi3_num_locks;
[MarshalAs(UnmanagedType.LPWStr)]
public string fi3_pathname;
[MarshalAs(UnmanagedType.LPWStr)]
public string fi3_username;
}
[DllImport("netapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
static extern int NetFileEnum(
string servername,
string basepath,
string username,
int level,
ref IntPtr bufptr,
int prefmaxlen,
out int entriesread,
out int totalentries,
IntPtr resume_handle
);
[DllImport("Netapi32.dll", SetLastError = true)]
static extern int NetApiBufferFree(IntPtr Buffer);
#endregion
|
|
|
|

|
intel96 wrote: I have been trying the following code in C#, but it fails.
I don't speak C# so I can't help you there.
intel96 wrote: I am thinking that NetFileEnum has a problem on Windows XP SP1, but it is too early to tell.
I just tried it on a Windows XP SP2 box and it ran fine.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|

|
Ok, I now have a working copy in C# and everything works great for remote share, but local shares queries do not work. Thanks for your time answering my other questions.
|
|
|
|

|
I want to Enumerate Users on remote System. I am using ADVAPI32.dll functions.
but they returns error access denied. I want to know how to get the rmote sstem users woth authentication (username,password). Is there any function available that can authenticate and get the inforamtion from Remote System.
Thanks in Advance
|
|
|
|

|
Waqas Ur Rehman wrote:
I am using ADVAPI32.dll functions.
but they returns error access denied.
Please provide a code snippet of what is not working.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|

|
This is probably a bit late, but what you could do is use the runas command with the username and password of an administrator on the remote system when you run your program.
E.g, at the command line:
runas /user:domainname\administrator ProgramName
This should fix any access denied errors when using network management functions
|
|
|
|

|
Hello
Nice work, one problem with NetFileEnum() function in that it only works for users that are administrators on the file server.
I wonder how to make it work with RunAs / Impersonating an administrator - without the currently logged in user being one.
Any help will be appreciated
Thanks
Alex
alex.evans@iinet.net.au
|
|
|
|

|
I need to build a library that links against svrapi.lib and not netapi32.lib, however I cannot find the lib anywhere. I'm on xp, i've searched the visual studio .net folder recursively (finding netapi32.lib i might add) and the platform sdk lib folder (also finding netapi32.lib). I know that i must link against svrapi.lib to enable support for the NetXXX functions on 9x, but it's a little hard to do when I can't get the lib file to build with!
I noticed that you diliberately left out 9x support, is that because you didn't want to waste the time on 9x, or because you also ran into this problem?
Any ideas? I've tried googlin' to find a download, but nadda just yet.
Later
-Mark
|
|
|
|

|
I have a same problem, I can't compile VC++ 6.0 project with NetShareEnum with svrapi.lib. (I use windows 2000 Prof, is this the problem? we must compile on Windows 9X platform? )
|
|
|
|

|
When I try to run netdemo.exe, I get a "NETAPI32.DLL" missing export error. I'm running on windows 98. Could you tell me why I'm getting this error? Thanks!
|
|
|
|

|
The sample was not compiled for Windows 9x. You can, however, modify it to use svrapi.lib instead of netapi32.lib.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|

|
Yes when i built it with unicode then it successfully give result..but Is it not possible to use this API without unicode..supposse when i used as below
TCHAR szUserName[32] = "\\\\VMCL-ASHIF";
dwStatus = NetShareEnum(szUserName, 2, (LPBYTE *) &pShareBuffer, MAX_PREFERRED_LENGTH, &dwSharesRead, &dwTotalShares, NULL);
if (NERR_Success == dwStatus && dwSharesRead > 0)
{
...........
}
Then NetShareEnum()returns 53..How can i solve this problem without UNICDE building.
|
|
|
|

|
KmAshif wrote:
How can i solve this problem without UNICDE building.
Use Windows 95/98/Me.
BTW, separate posts are not necessary.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|

|
Is it impossible to use in Windows 2000 without unicode.
|
|
|
|

|
Per MSDN, this particular function requires UNICODE on Windows 2000. Read the documentation for more details.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|

|
I have solved this By unicode conversion macro...
dwStatus = NetShareEnum((LPTSTR) ( (LPWSTR)A2W(strMachineName) ), 2, (LPBYTE *) &pShareBuffer, MAX_PREFERRED_LENGTH, &dwSharesRead, &dwTotalShares, NULL);
|
|
|
|

|
dwStatus = NetShareEnum((LPWSTR) ((LPCTSTR) strServer), 2, (LPBYTE *) &pShareBuffer, MAX_PREFERRED_LENGTH, &dwSharesRead, &dwTotalShares, NULL);
gives compile error "cannot convert parameter 1 from 'unsigned short *' to 'char *'" in my project
But in ur project no cmpile error..What is the caz.
Please let me know.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
A brief discussion on how to use NetShareEnum, NetConnectionEnum, and NetFileEnum
| Type | Article |
| Licence | |
| First Posted | 14 Mar 2004 |
| Views | 99,149 |
| Bookmarked | 31 times |
|
|