mfc >> Printing a File from disk programmatically

by U1NSb3k » Tue, 21 Mar 2006 13:12:27 GMT

In my program, I have a CString which stores the name of a text file with its
full path. I want my program to find the 'default' printer and print the file
on that printer. What is the easiest way to do that ? Does the MFC has any
support for this ?

Please advice,

Regards
Sanjoy Sinha Roy
HCL Technologies



mfc >> Printing a File from disk programmatically

by David Lowndes » Tue, 21 Mar 2006 15:44:37 GMT


>In my program, I have a CString which stores the name of a text file with its

Use the ShellExecute API with the "print" verb.

Dave



Similar Threads

1. Trying to print batch of PDF files programmatically

2. Programmatically Format Removable Disk - CSharp/C#

3. disk space - programmatically.

Hi,

given a string that represents a directory, e.g. c:\tmp\blah\boo

I would like to determine how many bytes are available in same directory. Does anybody know the windows api I should be looknig at. Don't even know where to start when it comes to windows system programming. 

thanks much and have a nice day. 


G

4. Get a file from my resource file and write it to disk - CSharp/C#

5. Printing PDF programmatically using 6.0

Hi there...

I have Acrobat Reader 6.0 installed (yes, I know it's old, but that's
what my company is using) on my machine and I have been trying to get
the following C# code (and other similar code) working in VS 2005 but
it throws an exception when loading the file. For the record, I have
added pdf.ocx as a reference to the C# project.

PdfLib.Pdf myPdf;
myPdf = new PdfLib.PdfClass();
myPdf.LoadFile(fileName);
myPdf.Print();

Any insight on what I am doing wrong?

After a little bit of researching, my impression is that this code will
not work without the Acrobat SDK or at least Acrobat installed. Is that
the case?

If that is the case and I successfully get this code working on my
developer machine with the Acrobat SDK, will it run on a machine that
only has Acrobat Reader 6.0 installed on it?

If I can run this executable on a machine with only Acrobat 6.0
installed, do I need to all need to distribute any other assemblies?

If I need to distribute any other assemblies, is it within the SDK
license to do so.

Thanks in advance

Ray

6. Programmatically close a form when using web browser control for printing - CSharp / C#

7. Creating a file programmatically gives wrong file ownership

When I create a file from a simple command line application written in C# the 
file ownership given to the newly created file is of administrators group 
although I am running this application in my identity. I would expect that a 
created file will get the ownership of the running process identity.

code:

in the Mail I have a single line: File.Create(@"c:\test.txt");

8. how to open a .pst file(data file in outlook) programmatically