Click here to Skip to main content
16,004,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAuthenticate NT user from ActiveX control? Pin
philip andrew13-Oct-02 18:45
philip andrew13-Oct-02 18:45 
AnswerRe: Authenticate NT user from ActiveX control? Pin
Stephane Rodriguez.13-Oct-02 19:17
Stephane Rodriguez.13-Oct-02 19:17 
GeneralRe: Authenticate NT user from ActiveX control? Pin
philip andrew13-Oct-02 19:36
philip andrew13-Oct-02 19:36 
GeneralRe: Authenticate NT user from ActiveX control? Pin
Stephane Rodriguez.13-Oct-02 19:48
Stephane Rodriguez.13-Oct-02 19:48 
GeneralRe: Authenticate NT user from ActiveX control? Pin
Daniel Turini14-Oct-02 0:14
Daniel Turini14-Oct-02 0:14 
GeneralRe: Authenticate NT user from ActiveX control? Pin
philip andrew14-Oct-02 13:59
philip andrew14-Oct-02 13:59 
GeneralRe: Authenticate NT user from ActiveX control? Pin
Daniel Turini14-Oct-02 20:07
Daniel Turini14-Oct-02 20:07 
QuestionModal printing via ShellExecute(Ex)? Pin
Ravi Bhavnani13-Oct-02 18:26
professionalRavi Bhavnani13-Oct-02 18:26 
I'm trying to programatically print an app-generated temporary .txt file, wait until the file has been spooled to the printer, then delete the file. Here's what I'm doing:
generateFile (strFilespec);
long nStatus = (long) ::ShellExecute
                        (m_hWnd, "print", strPrintFile,
                         NULL, "", SW_SHOWNORMAL);
if (nStatus <= 32)
   displayError();
deleteFile (strFilespec);
Because ShellExecute returns immediately after displaying the (unfortunately modeless) Print dialog, the file gets deleted before the user has an opportunity to respond to the dialog.

I could loop until I detect the absence of a top-level window named "Print" before deleting the file, but that solution reeks of cheddar. I also tried using ShellExecuteEx with the SEE_MASK_FLAG_DDEWAIT flag in the hope that I could the function to behave in a modal manner, but that didn't help.

Any ideas on how to spool a file to the printer in a modal manner would be greatly appreciated. Thanks!

/ravi

Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
AnswerRe: Modal printing via ShellExecute(Ex)? Pin
Stephane Rodriguez.13-Oct-02 19:14
Stephane Rodriguez.13-Oct-02 19:14 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Ravi Bhavnani13-Oct-02 19:20
professionalRavi Bhavnani13-Oct-02 19:20 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Stephane Rodriguez.13-Oct-02 19:31
Stephane Rodriguez.13-Oct-02 19:31 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Ravi Bhavnani14-Oct-02 0:49
professionalRavi Bhavnani14-Oct-02 0:49 
AnswerRe: Modal printing via ShellExecute(Ex)? Pin
Nish Nishant13-Oct-02 19:16
sitebuilderNish Nishant13-Oct-02 19:16 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Ravi Bhavnani13-Oct-02 19:17
professionalRavi Bhavnani13-Oct-02 19:17 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Nish Nishant13-Oct-02 19:29
sitebuilderNish Nishant13-Oct-02 19:29 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Stephane Rodriguez.13-Oct-02 19:32
Stephane Rodriguez.13-Oct-02 19:32 
GeneralRe: Modal printing via ShellExecute(Ex)? Pin
Ravi Bhavnani14-Oct-02 0:45
professionalRavi Bhavnani14-Oct-02 0:45 
Generalhelp! VC++ project desktop access in LAN Pin
B4u13-Oct-02 17:22
B4u13-Oct-02 17:22 
GeneralRe: help! VC++ project desktop access in LAN Pin
jmkhael14-Oct-02 0:41
jmkhael14-Oct-02 0:41 
GeneralVisual C++ and Windows XP Pin
dinger13-Oct-02 16:52
dinger13-Oct-02 16:52 
GeneralRe: Visual C++ and Windows XP Pin
Nish Nishant13-Oct-02 17:10
sitebuilderNish Nishant13-Oct-02 17:10 
GeneralRe: Visual C++ and Windows XP Pin
Jon Hulatt13-Oct-02 21:35
Jon Hulatt13-Oct-02 21:35 
GeneralRe: Visual C++ and Windows XP Pin
Gero Gerber14-Oct-02 7:11
Gero Gerber14-Oct-02 7:11 
GeneralRe: Visual C++ and Windows XP Pin
dinger15-Oct-02 6:28
dinger15-Oct-02 6:28 
GeneralHelp with STL and Function Adapters Pin
Neville Franks13-Oct-02 16:21
Neville Franks13-Oct-02 16:21 

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.