Click here to Skip to main content
15,889,651 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIO Completion Ports socket error Pin
yani dzhurov16-Jan-06 22:40
yani dzhurov16-Jan-06 22:40 
AnswerRe: IO Completion Ports socket error Pin
__yb17-Jan-06 11:35
__yb17-Jan-06 11:35 
QuestionFTP directory listing Pin
Angel Kafazov16-Jan-06 21:43
Angel Kafazov16-Jan-06 21:43 
AnswerRe: FTP directory listing Pin
David Crow17-Jan-06 4:24
David Crow17-Jan-06 4:24 
GeneralRe: FTP directory listing Pin
Angel Kafazov17-Jan-06 4:30
Angel Kafazov17-Jan-06 4:30 
QuestionShare names Pin
kelprinc16-Jan-06 20:39
kelprinc16-Jan-06 20:39 
AnswerRe: Share names Pin
vallikumar16-Jan-06 21:36
vallikumar16-Jan-06 21:36 
GeneralRe: Share names Pin
kelprinc16-Jan-06 21:45
kelprinc16-Jan-06 21:45 
When i try to use \\. i get an error 53 which i do not know what it means.
Any help

Here is my code

// test2.cpp : Defines the entry point for the console application.<br />
//<br />
<br />
#include "stdafx.h"<br />
#include "test2.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// The one and only application object<br />
<br />
CWinApp theApp;<br />
<br />
using namespace std;<br />
<br />
<br />
void wmain( int argc, TCHAR *lpszArgv[ ])<br />
{<br />
   PSHARE_INFO_502 BufPtr;<br />
   NET_API_STATUS res;<br />
   LPTSTR   lpszServer = NULL, lpszShare;<br />
   //<br />
   // Check command line arguments.<br />
   //<br />
   switch(argc)<br />
   {<br />
   case 3:<br />
      lpszServer = lpszArgv[2];<br />
   case 2:<br />
      lpszShare = lpszArgv[1];<br />
      break;<br />
   default:<br />
      printf("Usage: NetShareGetInfo sharename <servername>\n");<br />
      return;<br />
   }<br />
   //<br />
   // Call the NetShareGetInfo function, specifying level 502.<br />
   //<br />
  cout<<lpszServer<<" "<<lpszShare<<endl;<br />
   //<br />
   //if((res = NetShareGetInfo (lpszServer,lpszShare,502,(LPBYTE *) &BufPtr)) == ERROR_SUCCESS)<br />
    if((res = NetShareGetInfo ("\\.","guest"  ,502,(LPBYTE *) &BufPtr)) == ERROR_SUCCESS)<br />
   {<br />
      //<br />
      // Print the retrieved data.<br />
      //<br />
      printf("%S\t%S\t%u\n",BufPtr->shi502_netname, BufPtr->shi502_path, BufPtr->shi502_current_uses);<br />
      //<br />
      // Validate the value of the <br />
      //  shi502_security_descriptor member.<br />
      //<br />
      if (IsValidSecurityDescriptor(BufPtr->shi502_security_descriptor))<br />
         printf("It has a valid Security Descriptor.\n");<br />
      else<br />
         printf("It does not have a valid Security Descriptor.\n");<br />
      //<br />
      // Free the allocated memory.<br />
      //<br />
      NetApiBufferFree(BufPtr); <br />
   }<br />
   else <br />
   {<br />
      <br />
	  if(res == NERR_NetNameNotFound)<br />
		  cout<<"Netnamenotfound"<<endl;<br />
	  else if(res==ERROR_ACCESS_DENIED)<br />
		  cout<<"Access denied"<<endl;<br />
	  else if(res==ERROR_INVALID_LEVEL)<br />
		  cout<<"invalid level"<<endl;<br />
	  else if(res==ERROR_INVALID_PARAMETER)<br />
		  cout<<"invalid parameter"<<endl;<br />
	  else if(res==ERROR_MORE_DATA)<br />
		  cout<<"More data"<<endl;<br />
	  else if(res==ERROR_NOT_ENOUGH_MEMORY)<br />
		  cout<<"not enough memory"<<endl;<br />
	  else if(res==NERR_BufTooSmall)<br />
		  cout<<"buffer too small"<<endl;<br />
	  else<br />
      cout<<"Error "<<res<<endl;<br />
   }<br />
   return;<br />
}

GeneralRe: Share names Pin
_AnsHUMAN_ 16-Jan-06 21:50
_AnsHUMAN_ 16-Jan-06 21:50 
QuestionRe: Share names Pin
kelprinc16-Jan-06 22:10
kelprinc16-Jan-06 22:10 
AnswerRe: Share names Pin
vallikumar16-Jan-06 22:23
vallikumar16-Jan-06 22:23 
QuestionRe: Share names Pin
kelprinc16-Jan-06 22:28
kelprinc16-Jan-06 22:28 
AnswerRe: Share names Pin
_AnsHUMAN_ 16-Jan-06 22:29
_AnsHUMAN_ 16-Jan-06 22:29 
QuestionRe: Share names Pin
kelprinc16-Jan-06 22:34
kelprinc16-Jan-06 22:34 
AnswerRe: Share names Pin
David Crow17-Jan-06 4:28
David Crow17-Jan-06 4:28 
QuestionQuery related to Worker Threads & GUI Window? Pin
dp_7616-Jan-06 20:28
dp_7616-Jan-06 20:28 
AnswerRe: Query related to Worker Threads & GUI Window? Pin
Roger Stoltz16-Jan-06 21:37
Roger Stoltz16-Jan-06 21:37 
Answer[Message Deleted] Pin
Stephen Hewitt16-Jan-06 21:47
Stephen Hewitt16-Jan-06 21:47 
AnswerRe: Query related to Worker Threads & GUI Window? Pin
Stephen Hewitt16-Jan-06 21:47
Stephen Hewitt16-Jan-06 21:47 
Questionhow to convert the HTML files output to the image like bitmap or jpg Pin
Hemant kulkarni16-Jan-06 20:26
Hemant kulkarni16-Jan-06 20:26 
AnswerRe: how to convert the HTML files output to the image like bitmap or jpg Pin
kelprinc16-Jan-06 20:44
kelprinc16-Jan-06 20:44 
GeneralRe: how to convert the HTML files output to the image like bitmap or jpg Pin
Hemant kulkarni16-Jan-06 21:14
Hemant kulkarni16-Jan-06 21:14 
GeneralRe: how to convert the HTML files output to the image like bitmap or jpg Pin
Stephen Hewitt16-Jan-06 22:06
Stephen Hewitt16-Jan-06 22:06 
GeneralRe: how to convert the HTML files output to the image like bitmap or jpg Pin
Stephen Hewitt16-Jan-06 23:00
Stephen Hewitt16-Jan-06 23:00 
AnswerRe: how to convert the HTML files output to the image like bitmap or jpg Pin
Owner drawn16-Jan-06 22:15
Owner drawn16-Jan-06 22:15 

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.