Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: make this variable global Pin
sweep1235-Aug-04 6:39
sweep1235-Aug-04 6:39 
GeneralRe: make this variable global Pin
Jaime Stuardo5-Aug-04 9:21
Jaime Stuardo5-Aug-04 9:21 
GeneralRe: make this variable global Pin
sweep1235-Aug-04 22:19
sweep1235-Aug-04 22:19 
GeneralRe: make this variable global Pin
Henry miller5-Aug-04 7:48
Henry miller5-Aug-04 7:48 
GeneralRe: make this variable global Pin
Grahamfff6-Aug-04 11:07
Grahamfff6-Aug-04 11:07 
GeneralRe: make this variable global Pin
Henry miller6-Aug-04 11:30
Henry miller6-Aug-04 11:30 
GeneralRe: make this variable global Pin
sweep1238-Aug-04 22:12
sweep1238-Aug-04 22:12 
QuestionHow to convert a function into main() instead of wmain() ? Pin
Anonymous5-Aug-04 0:48
Anonymous5-Aug-04 0:48 
Hey
In MSDN there is one function called "NetShareEnum", They have also provided example for it. I want to write same exapmle usign main() instead of wmain(). Plz any one can help...? I am also writing whole code here. Plz you also write whole code changin it to mian()...Thanking you....
--------------------------------------------------------------
#define UNICODE
#include <windows.h>
#include <stdio.h>
#include <lm.h>

void wmain( int argc, TCHAR *lpszArgv[ ])
{
PSHARE_INFO_502 BufPtr,p;
NET_API_STATUS res;
LPTSTR lpszServer = NULL;
DWORD er=0,tr=0,resume=0, i;

switch(argc)
{
case 2:
lpszServer = lpszArgv[1];
break;
default:
printf("Usage: NetShareEnum <servername>\n");
return;
}
//
// Print a report header.
//
printf("Share: Local Path: Uses: Descriptor:\n");
printf("---------------------------------------------------------------------\n");
//
// Call the NetShareEnum function; specify level 502.
//
do // begin do
{
res = NetShareEnum (lpszServer, 502, (LPBYTE *) &BufPtr, -1, &er, &tr, &resume);
//
// If the call succeeds,
//
if(res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
{
p=BufPtr;
//
// Loop through the entries;
// print retrieved data.
//
for(i=1;i<=er;i++)
{
printf("%-20S%-30S%-8u",p->shi502_netname, p->shi502_path, p->shi502_current_uses);
//
// Validate the value of the
// shi502_security_descriptor member.
//
if (IsValidSecurityDescriptor(p->shi502_security_descriptor))
printf("Yes\n");
else
printf("No\n");
p++;
}
//
// Free the allocated buffer.
//
NetApiBufferFree(BufPtr);
}
else
printf("Error: %ld\n",res);
}
// Continue to call NetShareEnum while
// there are more entries.
//
while (res==ERROR_MORE_DATA); // end do
return;
}
----------------------------------------------------------------
Thank You
Mahesh

AnswerRe: How to convert a function into main() instead of wmain() ? Pin
David Crow5-Aug-04 2:29
David Crow5-Aug-04 2:29 
GeneralIDE Error/Problem I Think Pin
sweep1235-Aug-04 0:04
sweep1235-Aug-04 0:04 
GeneralRe: IDE Error/Problem I Think Pin
Cedric Moonen5-Aug-04 1:33
Cedric Moonen5-Aug-04 1:33 
GeneralRe: IDE Error/Problem I Think Pin
V.5-Aug-04 2:23
professionalV.5-Aug-04 2:23 
GeneralRe: IDE Error/Problem I Think Pin
David Crow5-Aug-04 2:36
David Crow5-Aug-04 2:36 
GeneralRe: IDE Error/Problem I Think Pin
sweep1235-Aug-04 2:40
sweep1235-Aug-04 2:40 
GeneralCVS dir comparer algo. Pin
Anthony_Yio5-Aug-04 0:02
Anthony_Yio5-Aug-04 0:02 
GeneralSDL1009 error while using Java Webservice from .NET 2003 Pin
arun14054-Aug-04 23:58
arun14054-Aug-04 23:58 
Generali can disable menu item but cannot gray it!!!!!!!! Pin
caykahve4-Aug-04 23:06
caykahve4-Aug-04 23:06 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Brian Delahunty4-Aug-04 23:15
Brian Delahunty4-Aug-04 23:15 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve4-Aug-04 23:27
caykahve4-Aug-04 23:27 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 3:39
Jaime Stuardo5-Aug-04 3:39 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve5-Aug-04 4:35
caykahve5-Aug-04 4:35 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 5:03
Jaime Stuardo5-Aug-04 5:03 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve5-Aug-04 5:27
caykahve5-Aug-04 5:27 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 6:06
Jaime Stuardo5-Aug-04 6:06 
Generalsolution! Pin
caykahve6-Aug-04 0:25
caykahve6-Aug-04 0:25 

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.