Open a .pdf file from C++ Win32 Console Application

  • Context: C/C++ 
  • Thread starter Thread starter CFDFEAGURU
  • Start date Start date
  • Tags Tags
    Application C++ File
Click For Summary
SUMMARY

This discussion centers on opening a .pdf file from a Visual C++ 2008 Express Edition console application. User Matt initially sought assistance for implementing this functionality, specifically allowing users to enter a number corresponding to a .pdf file for viewing, saving, or printing. After receiving external help, Matt successfully resolved the issue but did not share the specific code or resources used. Another user, Zain, expressed interest in obtaining this information to achieve similar functionality.

PREREQUISITES
  • Familiarity with Visual C++ 2008 Express Edition
  • Understanding of file handling in C++
  • Basic knowledge of Windows API for launching applications
  • Experience with user input handling in console applications
NEXT STEPS
  • Research how to use the ShellExecute function in Windows API to open .pdf files
  • Learn about file paths and command-line arguments in C++
  • Explore error handling techniques in C++ for file operations
  • Investigate creating a user-friendly console menu for file selection
USEFUL FOR

C++ developers, particularly those working with Visual C++ 2008, and anyone looking to integrate file handling and external application launching in console applications.

CFDFEAGURU
Messages
781
Reaction score
10
Hello all,

Does anyone know how to open a .pdf file (or a .exe) file from a Visual C++ 2008 express edition program?

What I am trying to do is to have the user enter a number that corresponds to a certain .pdf file and have that .pdf file open for the user to read,save,print, etc ...

Thanks
Matt
 
Technology news on Phys.org
Never mind all,

I received some help from outside the forum and all is well.

Thanks
Matt
 
Matt,

Can you please send me the code that you used or the links of the sites from where you received help, because I'm also trying to do the same but so far have only been successful in searching - that too from the most basic method (the one where you input all files in a .txt file use a string to match and then let the user know whether the file exists or not)

Any help will be really appreciated.

Waiting for your reply

Regards

Zain
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
12K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
8K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
6K