Loading Image into Control button VC++ 2010 - visual-c++

I am doing a dialog based application in VC++ 2010, where I am using different control buttons for different languages and I want to load different .png files into the button dynamically, But I am unable to load, please help me.

Look here for a good answer: http://www.functionx.com/visualc/controls/bmpbtn.htm
Hope this helps

Related

How to hook a Window Form within Microsft Excel from VBA?

I'm trying to hook a Window Form within Microsoft Excel itself like on the attached picture (This is an Addin called Kutools).
It is supposed to:
Fit on the right side of the Row number
Be Just below the name box
Be resizable and the window is resizable with it as well
Be collapsible or Expandable (like on the image)
I prefer to use the internal VBA of Excel to build and hook it as much as possible. But if I have to use an external Editor (Visual Studio C# or VB. Net ...) I'm willing to follow the instruction.
I searched all over the web but couldn't find a way to do this. I definitely appreciate your kind assistance on this.
Thanks for your help, I'm open to any suggestion!
If I am not mistaken, you are trying to create a custom task pane for Excel (add-in). If so, then this link might help you, but you need to build it with Visual studio using Office development tools:
https://learn.microsoft.com/en-us/visualstudio/vsto/custom-task-panes?view=vs-2019

VBA Ribbon validate imageMso

I'm creating a custom ribbon in Excel, and I'm using ImageMso's for icons. I downloaded the full list of Icons from Microsoft, and tried to create a menu that displays them all for me to choose, but some of them are not displaying.
Is there any way to validate if an imageMso code does not work with the current version of windows, and display a placeholder in it's place instead of a blank icon?
Thanks,
Daniel
In my experience the short answer is no, but I also haven't investigated or attempted to resolve it with any great tenacity. If it doesn't show up I will retry with a different icon.
Note that I am not an expert by any means, but have been playing around with customUI for a while.
There is a great free Add-In I found that helps with speeding up the whole process of identifying suitable icons. It's worth checking it out.
https://www.spreadsheet1.com/how-to-use-imagemso-icons-in-excel.html
Josh
PS. I hear this is particularly an issue going into the Office 2019.

Inserting a PDF file as a resource, and displaying the pages?

I am using Visual C++, MFC, and would like to:
(a) Load a pdf file as a resource
(b) Display this file, and be able to move through the pdf file.
The reason why I would like to load the pdf as a resource, is that I do not want the User to be able to download the pdf file (at least not easily).
Can someone please help me?
All the best
Alex
You don't need to use ActiveX to accomplish what you want. Adding a custom binary resource to the resource file should be sufficient. This had been asked here and here.
As far as I know there are a couple of PDF OCX/ActiveX controls that allow you to view PDF files.
From Adobe itself there is an ActiveX COM Control. You should be able to add it into your toolbox and to drag it on a MFC dialog.
Also I found an older article on CodeProject

vb.net How to prevent modeless form from being blocked by modal tool dialog in ArcMap?

I have a vb.net project running as a toolbar extension in ArcMap. Each one of my tools opens a modal dialog using the .ShowDialog() method. My client wants to be able to open a PDF document from the tools that will serve as the help documentation tool rather than a traditional method like HTMLHelp or Windows Help Viewer.
So, I've imported the Interop.AcroPDFLib.dll and set up a form with an AxAcroPDF (veiwer) object on it. Whenever the user clicks the help button on any of the tool dialogs, the help form opens using .Show() and goes to the associated page in the document using the .setCurrentPage method. Everything works great up to this point.
However, as you can imagine, because the tool dialog is modal, it blocks the user from being able to interact with the PDF form. So, what I need is a technique to prevent this block so that the user will be able to scroll pages, click links within the PDF, etc. while the tool dialog is open. I.e., I need a solution that will mimic using the traditional HTMLHelp veiwer.
I've tried opening the PDF form in a new thread, but that causes ArcMap to crash at Application.Run(New PDFForm). Maybe this is because I have very little experience with multithreading, or maybe because ArcMap does not support multithreading. Not sure.
Anyway, any suggestions to get me started would be greatly appreaciated.

Problem displaying Icon in a button in windows xp(SP2) (MFC)!

I had a problem in displaying icon in button along with the Text in MFC application.. after reading lot of arctilces I got a solution for that and it worked great.But when I tested my application in win xp(SP2)..it suprised me by not showing the icon..Check the below code which i used to display the icon along with a test in button..Please let me know if there are any fix for this issue..waiting for your replies
HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON4),
IMAGE_ICON,0,0,LR_DEFAULTCOLOR);
SendMessageA(::GetDlgItem(m_hWnd,IDC_ADD),BM_SETIMAGE,IMAGE_ICON,(LPARAM)(DWORD)addIcon);
If you're using VS2008 (you should), use CMFCButton from the Feature Pack. It has much better support for bitmapped buttons.
I can confirm that i can't get it to work (on Win2003, my primary development machine) and a brief search on the web found many complaints but no viable answers.
My only suggestion would be to do an ownerdraw button - handling the WM_DRAWITEM message is not difficult and may resolve this issue for you across the board.
see "Native Win32 Theme aware Owner-draw Controls without MFC"

Resources