Click here to Skip to main content
15,887,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert vbscript to c++ Pin
Mogaambo2-Jul-09 8:32
Mogaambo2-Jul-09 8:32 
GeneralRe: convert vbscript to c++ Pin
led mike2-Jul-09 9:00
led mike2-Jul-09 9:00 
GeneralRe: convert vbscript to c++ Pin
Mogaambo2-Jul-09 9:06
Mogaambo2-Jul-09 9:06 
GeneralRe: convert vbscript to c++ Pin
Stuart Dootson2-Jul-09 9:26
professionalStuart Dootson2-Jul-09 9:26 
GeneralRe: convert vbscript to c++ Pin
Mogaambo2-Jul-09 9:28
Mogaambo2-Jul-09 9:28 
QuestionRe: convert vbscript to c++ Pin
David Crow2-Jul-09 9:31
David Crow2-Jul-09 9:31 
AnswerRe: convert vbscript to c++ Pin
Mogaambo2-Jul-09 9:39
Mogaambo2-Jul-09 9:39 
GeneralRe: convert vbscript to c++ Pin
Mogaambo2-Jul-09 9:41
Mogaambo2-Jul-09 9:41 
// adminGroup.cpp : Defines the entry point for the console application.
//
#pragma comment(lib,"Netapi32.lib")
#include <stdio.h>
#include <windows.h>

#include < LMCONS.H>
#include <Lm.h>
#include <Lmaccess.h>
#define MAX_PREFERRED_LENGTH ((DWORD) -1)
#include "stdafx.h"

#include <iostream>

#include <string>
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{


// NET_API_STATUS ret = 0 ;
//LPCWSTR servername = NULL;
//LPCWSTR groupname = L"Administrators";
LPBYTE buffer = NULL;
//DWORD entriesRead;
//DWORD totalEntries;
//DWORD resumeHandle =0;
//
//typedef struct _LOCALGROUP_MEMBERS_INFO_1 {
// PSID lgrmi1_sid;
// SID_NAME_USE lgrmi1_sidusage;
// LPWSTR lgrmi1_name;
//}LOCALGROUP_MEMBERS_INFO_1, *PLOCALGROUP_MEMBERS_INFO_1, *LPLOCALGROUP_MEMBERS_INFO_1;
////function call
//ret=NetLocalGroupGetMembers (NULL, groupname, 1, &buffer, MAX_PREFERRED_LENGTH, &entriesRead, &totalEntries, &resumeHandle);
//LPLOCALGROUP_MEMBERS_INFO_1 pstMembersInfo = 0;
//for( DWORD dwIdx =0; dwIdx < entriesRead; dwIdx ++ )
//{
// //std::cout<< pstMembersInfo[dwIdx].lgrmi1_name ;
//}
//int n=0;



LPLOCALGROUP_MEMBERS_INFO_1 pstMembersInfo = 0;
DWORD entriesread = 0;
DWORD totalentries = 0;
LPWSTR FromFile2=NULL;
if( 0 != NetLocalGroupGetMembers( NULL, _T("Administrators"), 1, (LPBYTE*)
&buffer,MAX_PREFERRED_LENGTH,
&entriesread, &totalentries, 0 ))
{
//AfxMessageBox( _T("NetLocalGroupGetMembers failed !"));
// return ;
}
PLOCALGROUP_MEMBERS_INFO_1 pData = (PLOCALGROUP_MEMBERS_INFO_1)buffer;
for( DWORD dwIdx =0; dwIdx < entriesread; dwIdx ++ , pData++)
{
//printf("%S\n", pstMembersInfo[dwIdx].lgrmi1_name );;

//lstrcpy(FromFile2,pstMembersInfo[dwIdx].lgrmi1_name);
//std::cout<<(std::string) pstMembersInfo[dwIdx].lgrmi1_name <<std::endl;
wcout<< pData->lgrmi1_name <<std::endl;
//printf("%S\n", pData->lgrmi1_name );;
}
NetApiBufferFree( buffer );


return 0;

}

“You will never be a leader unless you first learn to follow and be led.”
–Tiorio

"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford

QuestionDynamic char Array Pin
jlgeris2-Jul-09 5:38
jlgeris2-Jul-09 5:38 
AnswerRe: Dynamic char Array Pin
jlgeris2-Jul-09 5:42
jlgeris2-Jul-09 5:42 
AnswerRe: Dynamic char Array Pin
«_Superman_»2-Jul-09 5:54
professional«_Superman_»2-Jul-09 5:54 
GeneralRe: Dynamic char Array Pin
jlgeris2-Jul-09 7:14
jlgeris2-Jul-09 7:14 
GeneralRe: Dynamic char Array Pin
Stuart Dootson2-Jul-09 9:20
professionalStuart Dootson2-Jul-09 9:20 
GeneralRe: Dynamic char Array Pin
jlgeris2-Jul-09 9:32
jlgeris2-Jul-09 9:32 
AnswerRe: Dynamic char Array Pin
Stuart Dootson2-Jul-09 10:46
professionalStuart Dootson2-Jul-09 10:46 
QuestionCString::Format causing Advanced Direct Buffer Access error Pin
colm omahony2-Jul-09 5:18
colm omahony2-Jul-09 5:18 
AnswerRe: CString::Format causing Advanced Direct Buffer Access error Pin
Stuart Dootson2-Jul-09 6:33
professionalStuart Dootson2-Jul-09 6:33 
GeneralRe: CString::Format causing Advanced Direct Buffer Access error Pin
colm omahony3-Jul-09 3:29
colm omahony3-Jul-09 3:29 
GeneralRe: CString::Format causing Advanced Direct Buffer Access error Pin
Stuart Dootson3-Jul-09 3:37
professionalStuart Dootson3-Jul-09 3:37 
GeneralRe: CString::Format causing Advanced Direct Buffer Access error Pin
colm omahony12-Jul-09 23:15
colm omahony12-Jul-09 23:15 
GeneralRe: CString::Format causing Advanced Direct Buffer Access error Pin
colm omahony12-Jul-09 23:55
colm omahony12-Jul-09 23:55 
GeneralRe: CString::Format causing Advanced Direct Buffer Access error Pin
Stuart Dootson12-Jul-09 23:59
professionalStuart Dootson12-Jul-09 23:59 
Questiontransparent window with OpenGL Pin
kedanz2-Jul-09 5:08
kedanz2-Jul-09 5:08 
AnswerRe: transparent window with OpenGL Pin
led mike2-Jul-09 5:35
led mike2-Jul-09 5:35 
AnswerRe: transparent window with OpenGL Pin
Sarath C2-Jul-09 5:39
Sarath C2-Jul-09 5:39 

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.