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

C / C++ / MFC

 
GeneralRe: Install the .Net framework Pin
toxcct27-May-04 5:29
toxcct27-May-04 5:29 
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 
I am trying to get the list of domains AND LIST OF COMPUTERS under each domain.
I am getting domains when I use the parameter RESOURCE_GLOBALNET in WNetOpenEnum.

I am getting list of only computers when I use the parameter RESOURCE_CONTEXT in WNetOpenEnum.

But my requirement is I would like to get computers under each domain.

How should I achive this .This is the code.Pls tell me where I am going wrong.
NETRESOURCE res[10];
HANDLE hMain;
int x,y,i;
DWORD dwCnt = 0xffffffff;
DWORD dwSize;
DWORD dwRes;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0,
NULL, &hMain);
dwSize = sizeof (res);

if (WNetEnumResource (hMain, &dwCnt, res, &dwSize) == NO_ERROR)
{
HANDLE hEnum;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, res,&hEnum);
while (dwRes == NO_ERROR || dwRes == ERROR_MORE_DATA)
{
dwCnt = 9;
dwSize = sizeof (NETRESOURCE) * 10;
dwRes = WNetEnumResource (hEnum, &dwCnt, res, &dwSize);
if (dwRes != ERROR_NO_MORE_ITEMS)
{
for ( i = 0; i < dwCnt; i++)
{
if (res[i].lpLocalName != NULL || res[i].lpRemoteName!= NULL)
{
//MessageBox(0,res[i].lpLocalName,res[i].lpRemoteName,0);
//Add this in to a list box. SendMessage (hwndList, LB_ADDSTRING, 0, (LPARAM)res[i].lpRemoteName) ;
}
}
}
WNetCloseEnum (hEnum);
}
WNetCloseEnum (hMain);



Pls guide
GeneralRe: Experts !Problem with WNetOpenEnum Pin
David Crow27-May-04 7:31
David Crow27-May-04 7:31 
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 

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.