Why DDE failed in windows shell extension?

N

NeilKwo

Hi everyone,

We want to print Word files to our own printer from explorer context
menu. E.g. we open a folder and then right click on a .doc file. We
have added a menu item "PrintToMyWriter" to the context menu. What we
want is when we click PrintToMyWriter, the .doc file will be opened and
printed silently to our own Printer(not system default printer). We
call the WinWord's "printto" command by DDE:

[FileOpen("%s")][FilePrintSetup "%s on
p",.DoNotSetAsSysDefault=1][FilePrint 0]
the 1st %s is the file we right clicked on and the 2nd %s is our own
printer name.

This worked fine in my test MFC application, i can print a word file to
our printer silently. But nothing happened in the context menu. When i
select PrintToMyWriter from the context menu, the file was opened (I
use ShellExecute(0, "open", ...) to open it). but that's all. I debuged
into it and found that DdeClientTransaction() call didn't work, though
it's return value is true.

So can anybody help me?
-Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top