Microsoft Visual Studio 'Unknown Bitmap Format' when editing the default toolbars - c++

I've created an application using Microsoft Foundation Class library (MFC) using the project creation wizard. I created a multiple-document interface (MDI) application. The wizard creates dummy toolbars and menus that you can work with. I extended the default toolbar with no issue however now when I try to edit it through the resource view, I get "Unknown Bitmap Format" and the toolbar doesn't open. I haven't changed the file outside of Visual Studio therefore I'm unsure as to what causing this. The toolbar still opens and works fine when the application is running, its just now I can't edit it. The Error Message
I can't seem to find a solution anywhere. The only other similar post I can find is here http://www.databaseforum.info/2/8/1e1b848b13ed1254.html however no solution has been found for them.

I've had the same error, using bitmaps exported from GIMP - and I found this post (which I haven't still tried):
https://www.curlybrace.com/words/2013/08/30/exporting-visual-studio-compatible-bitmaps-from-gimp/
When exporting bitmaps from GIMP, two options must be selected in order for the bitmaps to be compatible with Visual Studio:
Under Compatibility Options, check “Do not write color space information”.
Under Advanced Options, select “R8 G8 B8” under 24 bits.

Related

Qt tableview model not native Windows system font

I created a tableview with model, but the font is not the native system font. It currently looks like this (a combobox inside the tableview):
But in another textinput in the same application it looks correctly like this:
I use no custom fonts and have not overridden the Qt::FontRole (return invalid QVariant()). Why doesn't it use the system font? This is on Windows 10.
EDIT:
There doesn't seem to be any issue when running the executable on my laptop. I'm suspecting a mismatch in .dll files. It should be using the exact same ones but perhaps its using .dll files it finds on my system PATH.
EDIT:
After checking with ProcessExplorer it seems that it loads the correct dlls which are exactly the same my other system loads. The Visual C++ Redistributables versions are also exactly the same.
EDIT
Tried with Visual Studio 2017 (from 2015) with fresh Qt installation, but that doesn't solve the problem either.

BHO and internet explorer 11

I saw some code on codeproject like this and this. but both are not compatible with the new security policy of internet explorer add-ons, when i insert then on registry they show up on the IE add-ons list, but with the "incompatible" status. Some can show me a working example for IE11 add-on? or can show me what i need to change? (i already disabled the security mode, but even with that i couldn't make it work) there is something to do with EPM (Enhanced Protected Mode)?
Have you used regsvr32.exe to register your BHO? I have IE 11 and used your second link as a boilerplate project, and I have no problems getting the dll to work in IE (besides having problems with working with the IE api - but that's not relevant).
What I did to get the BHO to work:
Have IE 11
Have Visual Studio 2015
Download the project from codeproject, doubleclick the solution
Convert it to the new format and download the dependencies (VS asked me to convert it, and I didn't have VisualC++ for Visual Studio or something)
Build it in release (I haven't actually tried debug)
Execute regsvr32.exe in an admin command prompt
Start IE and enable the BHO when IE asks you to
That's basically everything I did, and I didn't get an error on the way.
EDIT: Oops, sorry for necroing this. That was not my intention.

"Failed To Create Empty Document" error in MDI application in MFC

I am using Visual Studio 2010 Ultimate. I created a new MDI Application, with Tabbed Documents, Document/View Architecture Enabled, Project Style MFC Standard and all other default options in the MFC Application Wizard. The View of my Application derives from CFormView. I add a CRichEditCtrl in the View using the Resource Editor. When, I run this application, I get an error showing a message box "Failed To Create Empty Document". However, everything runs fine for all other controls. Please Help!!
Make sure that you initialize rich edit libraries.
Insert AfxInitRichEdit or AfxInitRichEdit2 (if using Rich edit control ver. 2.0) call.
Both are loading appropriate version of the for you RICHED20.DLL (ver2.0) or RICHED32.DLL.
The best place to place this call is App's InitInstance.
add the this code in .h file:
DECLARE_DYNCREATE(YourClassName)
and add this code in .cpp file:
IMPLEMENT_DYNCREATE(YourClassName)
to replace DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC if they were there.

MFC Ribbon app not displaying ribbon - when .exe is copy pasted to a different machine

Well, I am facing a strange problem. I have developed a sample MFC ribbon application on my machine - Windows 7 , with Visual Studio 2008. When I copy paste the .exe onto my laptop and run the app , I don't see the ribbon menu (in fact the app has not menu now) .
I have tried looking up the .dll that load in each case(on my work machine and laptop) using process monitor but I am unable to locate what I might be missing. Any help will be greatly appreciated.
Edit 1 -
Ok, So thanks for your responses. Some progress has been made with this issue
I changed my IDE to VS 2010. The ribbon was coded manually and I figured out if I could add it as a resource maybe the problem would be solved. VS 2008 did not have the option of adding a ribbon as a resource.
I installed the VS 2010 Service Pack Redistributable X86/X64 depending on whether the machine is 32 or 64 bit.
I built a new "ribbontest.exe" app from VS 2010 and deployed it on other machines on which I would test my actual app. The ribbon for "ribbontest.exe" loads without any problems.
When I deploy my app and run it, first the old menubar loads for a sec or two, then the ribbon flashes and disappears.
A little history of the app I am referring to -
Initially my application had the menubar view. I followed this article http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c14929/MFC-Feature-Pack-An-Introduction.htm to accommodate a ribbon.
Any suggestions?
Most likely there's a conflict in the settings 'paths'. In your InitInstance() handler, you've got a statement like this:
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
SetRegistryKey(_T("yourappname"));
If you haven't changed that name yet, do it. If you did, open regedit.exe on your target machine and remove the whole key under HKCU\Software\yourappname and then try again.
MFC stores user customizations of Ribbons/Menus/... under that key. But if you changed your app those settings don't necessarily match anymore and you can end up with stuff not showing correctly or not at all.
Make sure you download and install the Visual C++ Redistributable Runtime on your destination machine: http://www.microsoft.com/en-us/download/details.aspx?id=29
Or, something like it. Make sure you have architecture (x86/x64) correct and make sure it matches with the service pack version you compile with.
Joe is right: you need redistributable.
Joe is right: you cannot run 64-bit program on 32-bit machine.
All of the above would be indicated by the system (missing DLL, configuration incorrect, or 64/32 bit discrepancy)
Joe is right: your application must be built for specific set of minimum Windows version and service pack.
In addition to Joe’s post you must run release build not debug build.
If all of those requirements are met and you still have this problem, try linking MFC statically and see if problem persists.

Turn off XP Theme in VS2008 compiled MFC App

We've just recently switched our C++ MFC Application from VS2005 to VS2008. Unfortunately in doing so our UI has appearance problems, with things like group boxes appearing blue rather than black, properties dialogs having a white background etc. I presume that in VS2008, MFC has been changed to respect the OS theme (in my case XP default theme). Unfortunately, changing all our controls and our custom toolbars to make the app look decent again is going to require a lot of work.
So, does anyone know if there is a way in code to put the app back in VS2005 mode? I found the following code
typedef void (WINAPI *tSetThemeAppProperties)( DWORD );
tSetThemeAppProperties pSetThemeAppProperties=0;
HINSTANCE handle = ::LoadLibrary("UxTheme.dll");
if (handle)
pSetThemeAppProperties = (tSetThemeAppProperties) ::GetProcAddress(handle,"SetThemeAppProperties");
if ( pSetThemeAppProperties)
{
// call function
pSetThemeAppProperties(0/*dwFlags*/);
}
::FreeLibrary(handle);
Which does stop the XP theme being picked up, but turns off ALL themes and leaves the application looking more dated than it did in VS2005.
thanks
It may be that VS2008 is including a Manifest file in the project that loads the version 6.0 comctl32.dll rather than the 5.82 comctl32.dll... both ship with Windows XP and newer.
Under "Properties->Configuration Properties->Linker->Manifest File", set the "Generate Manifest" option to "No".
Then add your own manifest file if you like, and set it under "Properties->Configuration Properties->Manifest Tool->Input and Output", "Input Resource Manifest".
Just make sure that if you add your own manifest file that it doesn't contain the reference to commctl32 v6.