Results 1 to 14 of 14

Thread: Windows Network

  1. #1

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  3. #3

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  4. #4

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  6. #6
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  7. #7

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Originally posted by CornedBee
    BTW it's not my first question here, if that's what you're referring to

    It's about my 8th
    ...

    Originally posted by Technocrat
    I will have to look at the other 8 questions then...
    Huh huh, even I wuddent get that wrong.

    I don't live here any more.

  9. #9
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  10. #10

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  11. #11

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    No, wait, I didn't...
    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.

  12. #12

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  13. #13
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    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


  14. #14

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width