Click here to Skip to main content
15,885,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multi Language Support Pin
RaviRanjanKr16-Feb-11 3:02
professionalRaviRanjanKr16-Feb-11 3:02 
QuestionImplementing Remeber me Facility Pin
pix_programmer14-Feb-11 2:12
pix_programmer14-Feb-11 2:12 
AnswerRe: Implementing Remeber me Facility Pin
CPallini14-Feb-11 2:33
mveCPallini14-Feb-11 2:33 
GeneralRe: Implementing Remeber me Facility Pin
pix_programmer14-Feb-11 2:41
pix_programmer14-Feb-11 2:41 
GeneralRe: Implementing Remeber me Facility Pin
CPallini14-Feb-11 2:56
mveCPallini14-Feb-11 2:56 
QuestionDrawText Pin
john563214-Feb-11 1:21
john563214-Feb-11 1:21 
AnswerRe: DrawText Pin
CPallini14-Feb-11 1:27
mveCPallini14-Feb-11 1:27 
QuestionCreating TCP/IP Port programatically [modified] Pin
msr_codeproject13-Feb-11 23:54
msr_codeproject13-Feb-11 23:54 
Hi I am trying to create a TCP/IP port programatically in win32.

Here is my code.

HANDLE hXcv;
PRINTER_DEFAULTS  pd = {NULL, NULL, SERVER_ACCESS_ADMINISTER};
TCHAR szBuf[MAX_PATH] ={0};

TCHAR			szMsg[512];
DWORD		dwLastError;

::lstrcpy(szBuf, TEXT(",XcvMonitor Standard TCP/IP Port"));

if(OpenPrinter(szBuf, &hXcv, &pd) != FALSE )
{
	OutputDebugString(TEXT("Hello. It worked....!"));
}
else
{
  dwLastError = GetLastError();
  wsprintf(szMsg, TEXT("OpenPrinter return error:%d\n"), dwLastError);
  OutputDebugString(szMsg);
}


> But the problem is OpenPrinter API failing and returning
error code as 5 (ERROR_ACCESS_DENIED).

> But when I try to create the port manually (print properties), port is created.
> I have logged in as an administrator and I have all permissions.

I am working on Windows Server 2008 R2 Statndard (64 bit OS)

Note: OpenPrinter API working fine if I turn-OFF User Account Settings (UAC). Failing if UAC is ON

Please tell me what's wrong with my code.

Thank you in advance.


Regards
msr

modified on Monday, February 14, 2011 6:29 AM

AnswerRe: Creating TCP/IP Port programatically Pin
ShilpiP14-Feb-11 19:01
ShilpiP14-Feb-11 19:01 
GeneralRe: Creating TCP/IP Port programatically Pin
msr_codeproject14-Feb-11 23:58
msr_codeproject14-Feb-11 23:58 
GeneralRe: Creating TCP/IP Port programatically Pin
ShilpiP15-Feb-11 0:37
ShilpiP15-Feb-11 0:37 
GeneralRe: Creating TCP/IP Port programatically Pin
msr_codeproject16-Feb-11 0:20
msr_codeproject16-Feb-11 0:20 
GeneralRe: Creating TCP/IP Port programatically Pin
ShilpiP16-Feb-11 0:29
ShilpiP16-Feb-11 0:29 
GeneralRe: Creating TCP/IP Port programatically [modified] Pin
msr_codeproject16-Feb-11 1:57
msr_codeproject16-Feb-11 1:57 
QuestionHow to reduce CPU uages with Opengl ? Pin
GAJERA13-Feb-11 19:36
GAJERA13-Feb-11 19:36 
AnswerRe: How to reduce CPU uages with Opengl ? Pin
Emilio Garavaglia14-Feb-11 9:03
Emilio Garavaglia14-Feb-11 9:03 
AnswerRe: How to reduce CPU uages with Opengl ? Pin
Cedric Moonen14-Feb-11 20:26
Cedric Moonen14-Feb-11 20:26 
QuestionNow I know why people use makefiles Pin
Craig Longman13-Feb-11 17:37
Craig Longman13-Feb-11 17:37 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan13-Feb-11 22:31
mveRichard MacCutchan13-Feb-11 22:31 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 2:54
Craig Longman14-Feb-11 2:54 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan14-Feb-11 5:01
mveRichard MacCutchan14-Feb-11 5:01 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 13:01
Craig Longman14-Feb-11 13:01 
AnswerRe: Now I know why people use makefiles Pin
Joe Woodbury14-Feb-11 12:34
professionalJoe Woodbury14-Feb-11 12:34 
QuestionNested structs problem [modified] Pin
manchukuo13-Feb-11 10:07
manchukuo13-Feb-11 10:07 
AnswerRe: Nested structs problem [modified] Pin
Richard MacCutchan13-Feb-11 10:39
mveRichard MacCutchan13-Feb-11 10: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.