Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Install the .Net framework Pin
sweep12327-May-04 5:59
sweep12327-May-04 5:59 
GeneralRe: Install the .Net framework Pin
Navin27-May-04 6:33
Navin27-May-04 6:33 
GeneralRe: Install the .Net framework Pin
sweep12327-May-04 6:38
sweep12327-May-04 6:38 
GeneralRe: Install the .Net framework Pin
Navin27-May-04 6:51
Navin27-May-04 6:51 
GeneralRe: Install the .Net framework Pin
Navin27-May-04 6:32
Navin27-May-04 6:32 
GeneralRe: Install the .Net framework Pin
sweep12327-May-04 22:45
sweep12327-May-04 22:45 
GeneralExperts !Problem with WNetOpenEnum Pin
Member 115017627-May-04 4:55
Member 115017627-May-04 4:55 
GeneralRe: Experts !Problem with WNetOpenEnum Pin
David Crow27-May-04 7:31
David Crow27-May-04 7:31 
This works fine for me:

bool GetResources( NETRESOURCE *pNetResource )
{
    DWORD       dwResult;
    NETRESOURCE *NetResource = NULL;
    HANDLE      hEnum;
    
    dwResult = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pNetResource, &hEnum);
    if (NO_ERROR == dwResult)
    {
        NETRESOURCE Buffer[750];
        DWORD       Count = 0xFFFFFFFF,
                    BufferSize;
         
        BufferSize = sizeof(Buffer);
 
        do
        {
            dwResult = WNetEnumResource(hEnum, &Count, &Buffer, &BufferSize);
 
            if (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult)
            {
                for (UINT i = 0; i < Count; i++)
                {
                    if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_DOMAIN)
                        cout << "Domain ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SERVER)
                        cout << "Server ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SHARE)
                        cout << "Share ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_GROUP)
                        cout << "Group ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_NETWORK)
                        cout << "Network ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_ROOT)
                        cout << "Root ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SHAREADMIN)
                        cout << "ShareAdmin ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_TREE)
                        cout << "Tree ";
                    else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_NDSCONTAINER)
                        cout << "NDS ";
                    else
                        cout << "Unknown ";
 
                    cout << Buffer[i].lpRemoteName << endl;
 
                    if ((Buffer[i].dwUsage & RESOURCEUSAGE_CONTAINER) == RESOURCEUSAGE_CONTAINER)
                        GetResources(&Buffer[i]);
                }
            }
 
        } while (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult);
 
        dwResult = WNetCloseEnum(hEnum);
    }
 
    return true;
}



"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralExperts !Problem with WNetOpenEnum Pin
ykutanoor27-May-04 4:54
ykutanoor27-May-04 4:54 
Generalcopy constructors and inheritance Pin
Wheatbread27-May-04 4:40
Wheatbread27-May-04 4:40 
GeneralRe: copy constructors and inheritance Pin
toxcct27-May-04 4:52
toxcct27-May-04 4:52 
GeneralRe: copy constructors and inheritance Pin
Wheatbread27-May-04 5:07
Wheatbread27-May-04 5:07 
GeneralRe: copy constructors and inheritance Pin
toxcct27-May-04 5:21
toxcct27-May-04 5:21 
GeneralRe: copy constructors and inheritance Pin
toxcct27-May-04 5:16
toxcct27-May-04 5:16 
GeneralRe: copy constructors and inheritance Pin
Wheatbread27-May-04 5:29
Wheatbread27-May-04 5:29 
GeneralRe: copy constructors and inheritance Pin
valikac27-May-04 5:38
valikac27-May-04 5:38 
GeneralRe: copy constructors and inheritance Pin
toxcct27-May-04 5:42
toxcct27-May-04 5:42 
GeneralRe: copy constructors and inheritance Pin
Wheatbread27-May-04 6:09
Wheatbread27-May-04 6:09 
Generalvalid numbers for IDC control id? (adding controls without using editor for more than 255) Pin
brettslote27-May-04 4:40
brettslote27-May-04 4:40 
GeneralRe: valid numbers for IDC control id? (adding controls without using editor for more than 255) Pin
Maximilien27-May-04 5:09
Maximilien27-May-04 5:09 
GeneralRe: valid numbers for IDC control id? (adding controls without using editor for more than 255) Pin
toxcct27-May-04 6:03
toxcct27-May-04 6:03 
GeneralRe: valid numbers for IDC control id? (adding controls without using editor for more than 255) Pin
David Crow27-May-04 7:07
David Crow27-May-04 7:07 
Generalhlep!!!!how to disable messenger Service ?(VC++) Pin
zxb8888888827-May-04 4:18
zxb8888888827-May-04 4:18 
GeneralRe: hlep!!!!how to disable messenger Service ?(VC++) Pin
Antony M Kancidrowski27-May-04 4:29
Antony M Kancidrowski27-May-04 4:29 
GeneralRe: hlep!!!!how to disable messenger Service ?(VC++) Pin
zxb8888888827-May-04 5:13
zxb8888888827-May-04 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.