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

C / C++ / MFC

 
AnswerRe: C++ destructor problem Pin
Fred Andres20-Nov-08 5:09
Fred Andres20-Nov-08 5:09 
AnswerRe: C++ destructor problem Pin
Roger Stoltz20-Nov-08 5:05
Roger Stoltz20-Nov-08 5:05 
QuestionAbout extracting image blocks Pin
berko300020-Nov-08 4:03
berko300020-Nov-08 4:03 
AnswerRe: Help my code Pin
Iain Clarke, Warrior Programmer20-Nov-08 4:10
Iain Clarke, Warrior Programmer20-Nov-08 4:10 
GeneralRe: Help my code Pin
Member 419459320-Nov-08 6:23
Member 419459320-Nov-08 6:23 
GeneralRe: Help my code Pin
Iain Clarke, Warrior Programmer20-Nov-08 10:31
Iain Clarke, Warrior Programmer20-Nov-08 10:31 
GeneralRe: Help my code Pin
Member 419459320-Nov-08 14:26
Member 419459320-Nov-08 14:26 
QuestionAPI call to find the port of a printer? [modified] Pin
sashoalm20-Nov-08 1:45
sashoalm20-Nov-08 1:45 
Hi, I need to find the port of a printer (not the parallel port). I have code which uses GetProfileString, but I don't think this is how it's supposed to be done. Is there any API call which will do what this does?

The code I have:
#define MyAppPrinterName "MyAppPrinterName"

void CWordAddin::AppendPrinterPort( char* szOurPrinter )
{
	char szPort[150]; GetProfileString("PrinterPorts", MyAppPrinterName, "", szPort, 150);
	int i, j;
	for (i=0; szPort[i] != '\0' && szPort[i] != ','; i++); i++; // sz[i] = ',' at the end
	for (j=0; szPort[i] != '\0' && szPort[i] != ','; i++, j++)
		szPort[j] = szPort[i];
	szPort[j] = 0;
	
	strcat(szOurPrinter, szPort);
}

CComQIPtr <<Word::_Application>> app = button->GetApplication();
char printer_name[150] = MyAppPrinterName " on "; AppendPrinterPort(printer_name);
app->PutActivePrinter(printer_name);


There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

modified on Thursday, November 20, 2008 7:52 AM

AnswerRe: API call to find the port of a printer? Pin
Randor 20-Nov-08 4:03
professional Randor 20-Nov-08 4:03 
GeneralRe: API call to find the port of a printer? Pin
sashoalm20-Nov-08 6:01
sashoalm20-Nov-08 6:01 
Questionhow to disable double click event on a button. Pin
Dhiraj kumar Saini20-Nov-08 1:00
Dhiraj kumar Saini20-Nov-08 1:00 
AnswerRe: how to disable double click event on a button. Pin
Code-o-mat20-Nov-08 1:30
Code-o-mat20-Nov-08 1:30 
GeneralRe: how to disable double click event on a button. Pin
Dhiraj kumar Saini20-Nov-08 1:50
Dhiraj kumar Saini20-Nov-08 1:50 
GeneralRe: how to disable double click event on a button. Pin
Code-o-mat20-Nov-08 2:00
Code-o-mat20-Nov-08 2:00 
GeneralRe: how to disable double click event on a button. Pin
Rajesh Katalkar23-Nov-08 7:58
Rajesh Katalkar23-Nov-08 7:58 
AnswerRe: how to disable double click event on a button. Pin
Alan Balkany20-Nov-08 3:40
Alan Balkany20-Nov-08 3:40 
GeneralRe: how to disable double click event on a button. Pin
PJ Arends20-Nov-08 9:44
professionalPJ Arends20-Nov-08 9:44 
GeneralRe: how to disable double click event on a button. Pin
Alan Balkany20-Nov-08 9:46
Alan Balkany20-Nov-08 9:46 
GeneralRe: how to disable double click event on a button. Pin
PJ Arends20-Nov-08 11:27
professionalPJ Arends20-Nov-08 11:27 
AnswerRe: how to disable double click event on a button. Pin
Rajesh Katalkar23-Nov-08 7:47
Rajesh Katalkar23-Nov-08 7:47 
AnswerRe: how to disable double click event on a button. Pin
sdc3954-Aug-11 2:28
sdc3954-Aug-11 2:28 
QuestionGetting Pre-Build Event error. Pin
Davinder Pal Singh20-Nov-08 0:05
Davinder Pal Singh20-Nov-08 0:05 
AnswerRe: Getting Pre-Build Event error. Pin
Code-o-mat20-Nov-08 0:12
Code-o-mat20-Nov-08 0:12 
QuestionHow to place a button control over a picture control or some other control Pin
manoharbalu19-Nov-08 23:51
manoharbalu19-Nov-08 23:51 
AnswerRe: How to place a button control over a picture control or some other control Pin
Code-o-mat20-Nov-08 0:09
Code-o-mat20-Nov-08 0:09 

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.