Click here to Skip to main content
15,903,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to distinguish file from directory ? Pin
Shiva Prasad4-Aug-04 17:59
Shiva Prasad4-Aug-04 17:59 
GeneralRe: How to distinguish file from directory ? Pin
PJ Arends4-Aug-04 18:16
professionalPJ Arends4-Aug-04 18:16 
GeneralSpy ++ , Thread and Message Pin
Danny Gilbert4-Aug-04 17:23
Danny Gilbert4-Aug-04 17:23 
GeneralRe: Spy ++ , Thread and Message Pin
Ryan Binns4-Aug-04 18:21
Ryan Binns4-Aug-04 18:21 
GeneralRe: Spy ++ , Thread and Message Pin
Danny Gilbert5-Aug-04 4:12
Danny Gilbert5-Aug-04 4:12 
GeneralRe: Spy ++ , Thread and Message Pin
Ryan Binns5-Aug-04 17:15
Ryan Binns5-Aug-04 17:15 
GeneralRe: Spy ++ , Thread and Message Pin
Danny Gilbert5-Aug-04 18:23
Danny Gilbert5-Aug-04 18:23 
QuestionHow to use a functin in ANSI which is taking UNICODE standard ? Pin
Amarelia4-Aug-04 17:17
Amarelia4-Aug-04 17:17 
Can anyone plz tell me how to use a function which is taking parameter as UNICODE into ANSI or such that it takes parameter as char. Or How to convert parameter from char UNICODE and UNICODE to ANSI ?

I am using function NetShareEnum : the example is same as given in MSDN. Also given below... What needs to be changed so that I can use main() instead of wmain() like...void main(int argc, char* argv[])...instead of (int argc, TCHAR* argv[])...

#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;
}

AnswerRe: How to use a functin in ANSI which is taking UNICODE standard ? Pin
PJ Arends4-Aug-04 17:37
professionalPJ Arends4-Aug-04 17:37 
GeneralButton Pin
Archer2824-Aug-04 16:59
Archer2824-Aug-04 16:59 
GeneralRe: Button Pin
PJ Arends4-Aug-04 17:21
professionalPJ Arends4-Aug-04 17:21 
QuestionAutomate &quot;New Connection Wizard&quot;? Pin
guangguang4-Aug-04 16:06
guangguang4-Aug-04 16:06 
AnswerRe: Automate &quot;New Connection Wizard&quot;? Pin
Cohen6-Aug-04 0:41
Cohen6-Aug-04 0:41 
QuestionMemory leak again? Pin
ting6684-Aug-04 16:02
ting6684-Aug-04 16:02 
AnswerRe: Memory leak again? Pin
Anthony_Yio4-Aug-04 19:56
Anthony_Yio4-Aug-04 19:56 
AnswerRe: Memory leak again? Pin
User 5838524-Aug-04 20:00
User 5838524-Aug-04 20:00 
GeneralUsing cursor as Icons in toolbar Pin
mango_lier4-Aug-04 13:03
mango_lier4-Aug-04 13:03 
GeneralRe: Using cursor as Icons in toolbar Pin
Antti Keskinen5-Aug-04 6:37
Antti Keskinen5-Aug-04 6:37 
Generaldisable the Task manager Pin
X20404-Aug-04 12:30
X20404-Aug-04 12:30 
GeneralRe: disable the Task manager Pin
Antti Keskinen5-Aug-04 6:40
Antti Keskinen5-Aug-04 6:40 
GeneralRe: disable the Task manager Pin
Bo Hunter5-Aug-04 12:17
Bo Hunter5-Aug-04 12:17 
GeneralRe: disable the Task manager Pin
ThatsAlok5-Aug-04 22:15
ThatsAlok5-Aug-04 22:15 
GeneralMenu check button ... Pin
smack_2k24-Aug-04 10:11
smack_2k24-Aug-04 10:11 
QuestionHow to send mouse/keyboard to a background app? Pin
Member 6253944-Aug-04 9:00
Member 6253944-Aug-04 9:00 
AnswerRe: How to send mouse/keyboard to a background app? Pin
crondeemon4-Aug-04 9:48
crondeemon4-Aug-04 9:48 

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.