Click here to Skip to main content
15,894,337 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Exe File Pin
Mazdak27-Jun-02 10:20
Mazdak27-Jun-02 10:20 
GeneralRe: Exe File Pin
27-Jun-02 10:22
suss27-Jun-02 10:22 
GeneralRe: Exe File Pin
Navin27-Jun-02 12:33
Navin27-Jun-02 12:33 
GeneralRe: Exe File Pin
[Shadow]27-Jun-02 14:31
[Shadow]27-Jun-02 14:31 
Generalsdi . problem Pin
SilentWarrior27-Jun-02 8:43
SilentWarrior27-Jun-02 8:43 
GeneralRe: sdi . problem Pin
Alexandru Savescu27-Jun-02 10:46
Alexandru Savescu27-Jun-02 10:46 
GeneralRe: sdi . problem Pin
Prem Kumar27-Jun-02 19:50
Prem Kumar27-Jun-02 19:50 
Generalprinter bins Pin
pnpfriend27-Jun-02 8:29
pnpfriend27-Jun-02 8:29 
Hi all,
I'm writing a function that will print the first page of the document from the tray1 and the rest from the tray2.
so i wrote codes as following. However i have runtime error at
GetDeviceCapabilities(...)
What did I do wrong? and How should I fixed it??

<br />
<br />
CPrintDialog dlg(FALSE);<br />
  CDC dcPrinter;<br />
  DOCINFO docinfo;<br />
  dlg.GetDefaults();<br />
  HDC hdcPrinter = dlg.GetPrinterDC();<br />
  HDC DefaultPrinter = hdcPrinter;<br />
  dcPrinter.Attach(hdcPrinter);<br />
  <br />
  if (theApp.my_DevMode != NULL) <br />
    ::GlobalFree(theApp.my_DevMode);<br />
  theApp.my_DevMode = dlg.m_pd.hDevMode;	<br />
  LPDEVMODE lp = (LPDEVMODE) ::GlobalLock(theApp.my_DevMode); <br />
  ASSERT(lp); <br />
<br />
LPCTSTR pDevice = (LPCTSTR)dlg.GetDeviceName();    // pointer to a printer-name string<br />
LPCTSTR pPort = (LPCTSTR)dlg.GetPortName();      // pointer to a port-name string<br />
WORD fwCapability = DC_BINS;  // device capability to query<br />
LPTSTR pOutput;     // pointer to the output<br />
<br />
DeviceCapabilities(pDevice,pPort,fwCapability,pOutput,lp);  // program stop here. runtime error. runtime error<br />
<br />
if(pOutput!=NULL)<br />
{<br />
  CWordArray binsArray = (CWordArray)pOutput;  <br />
lp->dmDefaultSource = binsArray.GetAt(0);  // print from whatever tray in the binsarray zero.<br />
}<br />
<br />
  dcPrinter.ResetDC(lp);<br />
<br />

GeneralRe: printer bins Pin
Mike Nordell28-Jun-02 9:14
Mike Nordell28-Jun-02 9:14 
GeneralRe: printer bins Pin
pnpfriend1-Jul-02 3:16
pnpfriend1-Jul-02 3:16 
GeneralError: No Matching DLGINIT Pin
ssirisha27-Jun-02 7:01
ssirisha27-Jun-02 7:01 
GeneralRe: Error: No Matching DLGINIT Pin
Prem Kumar27-Jun-02 19:53
Prem Kumar27-Jun-02 19:53 
GeneralRe: Error: No Matching DLGINIT Pin
ssirisha28-Jun-02 1:40
ssirisha28-Jun-02 1:40 
GeneralRe: Error: No Matching DLGINIT (Solution) Pin
ssirisha28-Jun-02 2:14
ssirisha28-Jun-02 2:14 
GeneralMSN server connection Pin
27-Jun-02 6:40
suss27-Jun-02 6:40 
GeneralRe: MSN server connection Pin
Bill Wilson27-Jun-02 9:40
Bill Wilson27-Jun-02 9:40 
GeneralRe: MSN server connection Pin
27-Jun-02 11:08
suss27-Jun-02 11:08 
GeneralCore API Application and manifest Pin
S van Leent27-Jun-02 6:33
S van Leent27-Jun-02 6:33 
QuestionHow to write burning program for CDR! Pin
sunghj27-Jun-02 6:07
sunghj27-Jun-02 6:07 
AnswerRe: How to write burning program for CDR! Pin
Christian Graus27-Jun-02 13:32
protectorChristian Graus27-Jun-02 13:32 
AnswerRe: How to write burning program for CDR! Pin
Mike Nordell28-Jun-02 9:16
Mike Nordell28-Jun-02 9:16 
GeneralGetting the Device Context Pin
JennyP27-Jun-02 6:03
JennyP27-Jun-02 6:03 
GeneralRe: Getting the Device Context Pin
Roger Allen27-Jun-02 6:20
Roger Allen27-Jun-02 6:20 
GeneralRe: Getting the Device Context Pin
JennyP27-Jun-02 6:30
JennyP27-Jun-02 6:30 
GeneralRe: Getting the Device Context Pin
Roger Allen27-Jun-02 6:37
Roger Allen27-Jun-02 6:37 

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.