Click here to Skip to main content
15,917,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ALT + F4 Pin
Mike Nordell29-Apr-02 14:09
Mike Nordell29-Apr-02 14:09 
GeneralRe: ALT + F4 Pin
bishbosh0229-Apr-02 22:16
bishbosh0229-Apr-02 22:16 
GeneralRe: ALT + F4 Pin
Mike Nordell1-May-02 9:20
Mike Nordell1-May-02 9:20 
GeneralRe: ALT + F4 Pin
bishbosh021-May-02 21:42
bishbosh021-May-02 21:42 
QuestionenumPrinters anyone? Pin
Roger Allen29-Apr-02 3:49
Roger Allen29-Apr-02 3:49 
AnswerRe: enumPrinters anyone? Pin
Michael P Butler29-Apr-02 3:59
Michael P Butler29-Apr-02 3:59 
AnswerRe: enumPrinters anyone? Pin
Ravi Bhavnani29-Apr-02 4:05
professionalRavi Bhavnani29-Apr-02 4:05 
AnswerRe: enumPrinters anyone? Pin
Carlos Antollini29-Apr-02 4:10
Carlos Antollini29-Apr-02 4:10 
The following code is for get the default printer
<br />
PRINTER_INFO_2 *ppi2 = NULL;<br />
DWORD dwNeeded = 0;<br />
DWORD dwReturned = 0;<br />
<br />
EnumPrinters(PRINTER_ENUM_DEFAULT, NULL, 2, NULL, 0, &dwNeeded, &dwReturned);<br />
    if (dwNeeded == 0) <br />
      return FALSE;<br />
    <br />
    // Allocate enough space for PRINTER_INFO_2...<br />
    ppi2 = (PRINTER_INFO_2 *)GlobalAlloc(GPTR, dwNeeded);<br />
    if (!ppi2)<br />
      return FALSE;<br />
    <br />
    bFlag = EnumPrinters(PRINTER_ENUM_DEFAULT, NULL, 2, (LPBYTE)ppi2, dwNeeded, &dwNeeded, &dwReturned);<br />
    if (!bFlag)<br />
    {<br />
      GlobalFree(ppi2);<br />
      return FALSE;<br />
    }<br />
    <br />
    // If given buffer too small, set required size and fail...<br />
    if ((DWORD)lstrlen(ppi2->pPrinterName) >= *pdwBufferSize)<br />
    {<br />
      *pdwBufferSize = (DWORD)lstrlen(ppi2->pPrinterName) + 1;<br />
      GlobalFree(ppi2);<br />
      return FALSE;<br />
    }<br />
    <br />
    // Copy printer name into passed-in buffer...<br />
    lstrcpy(pPrinterName, ppi2->pPrinterName);<br />


Best Regards...

Carlos Antollini.
Sonork ID 100.10529 cantollini
AnswerThanks, am looking into the references Pin
Roger Allen29-Apr-02 5:19
Roger Allen29-Apr-02 5:19 
Questionhow to chang the tooltip of the buttons on the toolbar? Pin
benben29-Apr-02 3:03
benben29-Apr-02 3:03 
AnswerRe: how to chang the tooltip of the buttons on the toolbar? Pin
Shog929-Apr-02 4:37
sitebuilderShog929-Apr-02 4:37 
Generalhelp needed Pin
29-Apr-02 2:32
suss29-Apr-02 2:32 
GeneralRe: help needed Pin
Christian Graus29-Apr-02 2:35
protectorChristian Graus29-Apr-02 2:35 
GeneralRe: help needed Pin
29-Apr-02 2:46
suss29-Apr-02 2:46 
GeneralRe: help needed Pin
29-Apr-02 2:51
suss29-Apr-02 2:51 
GeneralRe: help needed Pin
29-Apr-02 3:05
suss29-Apr-02 3:05 
GeneralRe: help needed Pin
29-Apr-02 3:32
suss29-Apr-02 3:32 
Generali have trouble with my static backgrounds... Pin
Atilla Selem29-Apr-02 2:28
Atilla Selem29-Apr-02 2:28 
GeneralWindows Script Host Pin
soup29-Apr-02 1:42
soup29-Apr-02 1:42 
GeneralRe: Windows Script Host Pin
Michael P Butler29-Apr-02 3:31
Michael P Butler29-Apr-02 3:31 
GeneralSilly MFC CString Question Pin
carrie29-Apr-02 1:42
carrie29-Apr-02 1:42 
GeneralRe: Silly MFC CString Question Pin
Christian Graus29-Apr-02 2:43
protectorChristian Graus29-Apr-02 2:43 
GeneralToolTip Problem Pin
Kyudos29-Apr-02 1:36
Kyudos29-Apr-02 1:36 
GeneralRe: ToolTip Problem Pin
Ravi Bhavnani29-Apr-02 3:21
professionalRavi Bhavnani29-Apr-02 3:21 
QuestionA bug? And what to do to fix it? Pin
Igor Urdenko29-Apr-02 0:23
Igor Urdenko29-Apr-02 0:23 

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.