|
-
Nov 17th, 2003, 11:28 AM
#1
Windows Network
How do I find which computers are available on a Windows network?
I experimented with IShellFolder, but no success.
Thx in advance
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 17th, 2003, 12:18 PM
#2
Frenzied Member
I should write this down some where, because this is a first and will probably never happen again 
Anyways I tried to figure this out once before but only had limited success. In the end I just threaded a ping class and pinged the network looking for vaild IPs. Then tried to resolve the name of the IP. If it couldnt resolve then I assumed it wasnt a computer. I was a good enough answer for what I needed at the time.
But I believe that windows just sends out a NetBIOS broadcast and then resolves the names of those that respond. So if you can figure out how to get NetBIOS working you should be able to figure it out. I did a search on SourceForge.net and found a bunch of source code for NetBios, and Network Browse. Something in there should help going in the right direction.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 17th, 2003, 04:18 PM
#3
That's stupid, I can't imagine Explorer being implemented this way.
I'll take a look at the IRemoteComputer interface, maybe that'll take me further.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 17th, 2003, 04:33 PM
#4
BTW it's not my first question here, if that's what you're referring to 
It's about my 8th
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 17th, 2003, 04:35 PM
#5
Frenzied Member
I will have to look at the other 8 questions then
No one ever claimed MS was good at networking.
I found this code it MFC but it might help
Code:
#include "winnetwk.h"
#pragma comment (lib, "mpr")
...
void EnumLocalNetwork(NETRESOURCE *lpnr)
{
HANDLE hEnum;
DWORD cEntries = -1, cbBuffer = 0x4000;
if (::WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, lpnr, &hEnum) == 0) {
if ((lpnr = (LPNETRESOURCE)::GlobalAlloc(GPTR, cbBuffer)) != NULL) {
while (::WNetEnumResource(hEnum, &cEntries, lpnr, &cbBuffer) == 0) {
for (int ctr = 0; ctr < (int)cEntries; ctr++) {
if (lpnr[ctr].dwDisplayType == RESOURCEDISPLAYTYPE_NETWORK ||
lpnr[ctr].dwDisplayType == RESOURCEDISPLAYTYPE_DOMAIN)
EnumLocalNetwork(&lpnr[ctr]);
else {
AfxMessageBox(lpnr[ctr].lpRemoteName);
}
}
cEntries = -1;
cbBuffer = 0x4000;
}
::GlobalFree(lpnr);
}
::WNetCloseEnum(hEnum);
}
}
void CMFDDLGDlg::OnOK()
{
EnumLocalNetwork(NULL);
MessageBox("DONE");
}
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 17th, 2003, 04:37 PM
#6
Frenzied Member
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 17th, 2003, 04:40 PM
#7
Thanks a lot. Will try it out tomorrow.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 18th, 2003, 11:19 AM
#8
I don't live here any more.
-
Nov 18th, 2003, 12:13 PM
#9
Frenzied Member
Man some times you guys are too pick
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 19th, 2003, 03:50 AM
#10
Arrrgh! Found out I already did it correctly and the error was somewhere else!
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 19th, 2003, 03:53 AM
#11
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 19th, 2003, 05:45 AM
#12
Ok, got it now. Thanks for that code Tech.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 19th, 2003, 11:05 AM
#13
Frenzied Member
Your welcome
Glad to help you for a change
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Nov 19th, 2003, 03:06 PM
#14
I wrote a custom iterator that iterates over all filesystem roots and network shares, compatible with the boost filesystem library. Only needs a bit of error checking now.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|