Viewing PDF file in visual C++ GUI - visual-c++

I am currently using the Adobe PDF reader control on my GUI and am viewing PDF's with the following code:
OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
openFileDialog1->ShowDialog();
axAcroPDF1->src=openFileDialog1->FileName;
This code is inside of a button pressed function so that when I press the button a file browser opens, when the PDF is selected it opens and can be viewed on the GUI.
Is there a way of automatically opening the PDF every time the GUI is launched so that I do not have to manually browse and find the PDF file?

Find the place to add code to the On Activate event of your UI. In that location set the src property of the Adobe Acrobat control to the path of the file you want to open.
The following StackOverflow question and answer should give you everything you need to embed elements into an exe and find them afterwards with FindResource:
Visual C++ Get a resource's path

Related

View PDF in Internet Explorer with preventing user to download or print

I want to show the PDF in Internet Explorer in a way that it isn't downloaded or printable by the user.
Trying to show the PDF in iframe in Internet Explorer. Want to hide the toolbar shown with download and print functionality. If I anyhow hide the toolbar, the PDF still can be printed by right clicking on it and print option is shown. Let me know the solution to prevent user from downloading and printing the PDF file.
Just allow the user to view the PDF and cannot download or print it.
There is no any options available in internet Explorer or in that add on which shows the PDF file in Internet Explorer to prevent user from downloading or printing the PDF files.
If you are displaying the PDF file than users have many options to download or print it.
User can take a snapshot or use print screen or simply copy the text from your PDF.
So you cannot block all the options and there is no any built in option for this.
what you can do is display your PDF as an image with your own watermark in it.
So if someone downloads it than also the viewer knows the source of the file and its content.

Add-in adds button to Home without code?

I have downloaded a simple XLAM add-in (I think it's from Microsoft) to remove all non native styles from the active workbook.
This add-in adds a Remove Styles button next to Home/Styles.
However, I looked at the code in the add-in and I can't find any trace of code to add/remove this button.
Can someone explain how to do this magic trick ?
CustomUI elements are xml code that lives in the workbook. There are couple of ways you can see this.
Download the Custom UI Editor for Microsoft Office
Download the Ribbon editor from YourSumBuddy
Change the name of the file to RemoveSytles.zip (all Excel docs are really just compressed file). Open the zip file and navigate to the customUI folder. Open customUI.xml in your favorite text editor.

Closing or opening an Excel or Word file in Selenium IDE

Testing a website that has links to various forms. PDF forms work fine as long as I use the “goBackAndWait” command. However if the document is a Word or Excel document, clicking the link opens the document in a new window (not a pop up window). Using the “close” command closes the main window and not the document window.
How to close or open the Excel or word file using Selenium IDE and go back to the page.
Note that the Selenium IDE cannot interact with embedded objects by default.
I can offer you an alternative. Instead of opening the window, I recommend that you just check the URL of the links that you are clicking, and that the href points to the appropriate document extension.
Pseudo:
validatePresent | css=#doclink[href$='.docx']

Issue With Excel Template Files

I have been using Microsoft Excel 2003 since it first came out and am only just coming across an apparent problem with it. I have a number of .xlt files that are used throughout the company and have never had any issues with them. However, it has just come to light that there is a user who can change the template.
Ordinarily you open the Template file (e.g. Template.xlt) and on opening it find it is called Template1. On pressing the save icon you are taken to the the Save As screen with the default option to save the file as Template1.xls in MyDocuments (Default location).
In this one case though, the user opens the file as Template, and on pressing the save icon overwrites the original .xlt file. I have never seen this before and am bamboozled. Any ideas please?
How exactly does the user open the template?
If a template is opened by double clicking the .xlt (or .xltx/.xltm) file in Windows Explorer, the template generates a new Excel file based on the template.
If an .xlt (or .xltx/.xltm) is right-clicked in Windows Explorer and then the "Open" command is selected in the context menu, then the template file itself will be opened.
If an .xlt (or .xltx/.xltm) template file is opened via Excel's File > Open dialog, the template file itself is opened.
A shortcut that leads to an Excel template behaves in this way:
double-click - creates a new file based on the template.
right-click > New - creates a new file based on the template.
right-click > Open - opens the template itself.
Edit: if the behaviour of double clicking a template file (or a link to a template) occurs only for one user, you may want to unregister and re-register Excel 2003.
Quoting from this question at the Microsoft Answers forum:
> Start>Run>excel /unregserver
> - note the space between excel and /unregserver then
> Start>Run>excel /regserver
> - again note the space between excel and /regserver
I know it's not the best form to answer your own questions, but hopefully someone else will be able to benefit from the solution that I have found.
In order to solve this, download and install a program named FileTypesMan.
Run the program and find the .xlt extension. In an ordinary working system this will have at least New and Open as options with New set to default. In this case there was only Open as an option. Create an option for New and set this to default.....Presto, sorted.

Dreamweaver CS5 opening .CSHTML razor files

Is there a way to force Dreamweaver to open .CSHTML files as HTML file in editor, so I can use the code completion and all the other feature on a .CSHTML file
I was only been able to force it to open it in the code editor which doesn't have all the design features.
You may take a look at the following article.
Could I just recommend that if anyone is trying to open .CSHTML files in Dreamweaver and it is opening in TextEdit(Mac). What I did to solve this issue is to go to Preferences > File Types / Editors.
From here add ' .cshtml' to the "Open in code view" text box(note the space before the period, this is required).
Next I clicked the "+" symbol above "Extensions" list of file types, then added '.cshtml' to this list.
Close and reopen Dreamweaver and you should find that when you try and open a .CSHTML file(particularly opening the file via a 'Remote server' connection).
Daniel.

Resources