My application is developped using Visual Studio 2010 and the Qt5 framework.
I've created a qrc resources file using the Qt VS-addin, with some PNG images inside.
The QRC file is included in the Resources section of my VS project.
But my images are still not displayed on Windows on runtime, neither in debug or release build.
The Linux port of my application displays these images.
Any idea?
Thanks.
Edit: I'm using Qt Designer to load images, using QLabel. That said, manually specifying the PNG image using setPixmap() doesn't work neither.
Edit 2: Apparently, the problem seems to be caused by the qrc file which has an underscore in its name. Renaming the qrc in a more conventional way fixed the issue. I guess that using special characters in such files require escaping or sort of.
In your Qt directory there is a folder named plugins, inside plugins folder, a folder with the name imageformats exists, copy imageformats folder to your compilation output directory.
Problem solved, here is copy of my comment above.
Apparently, the problem seems to be caused by the qrc file which has an underscore in its name. Renaming the qrc in a more conventional way fixed the issue. I guess that using special characters in such files require escaping or sort of.
Related
What I want to do is to programmatically update resources of an executable file.
I have a binary resource (.res) file containg bitmaps, icons, version info and a manifest, created with a resource editor, and a PE file compiled with AutoHotkey to which I want to copy the resources from the .res file.
Until now I used to do this with ResourceHacker in command prompt, but ResourceHacker can't be redistributed and besides I want to do this more elegantly.
So I was looking in the WinAPI functions and there seems to be a way to do this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648008%28v=vs.85%29.aspx
But the problem is that the article describes how to copy resources from an executable file to another, and you can't import non-executable files (the .res file) with LoadLibrary/LoadLibraryEx.
There also seems to be a way to do this with tools from Visual Studio, particularly LINK.exe. But I'm not sure if it can be used outside of the VS enviroment. I have no idea how it works.
You can programmatically update resources with the UpdateResource function
RES files are not involved. RES files are used by the project makefile system to enable minimal rebuild of resources... they don't have to be recompiled every time the application is relinked, just embedded. But you aren't relinking the application and losing the existing resources, so updating just the resources you want to change is the way to go.
If your source assets are already encoded in RES files, then this page describing "Resource File Formats" can help you extract them. It also describes use of LINK.exe for resource embedding. LINK.exe is installed as part of Visual Studio, but it is also available in many versions of the Platform SDK and Windows DDK.
I am using Qt Creator 5.3 but any Jpeg images that I put into the build so not show up when I launch my exe. I got it working before by putting the necessary plugin dlls into the directory but now i still have this problem. In my research the only answer I found was to put the plugin dlls into the directory (which i already did) thank you.
add the image files to a resources file. It is very efficient and it is also cross platform. check out this link http://qt-project.org/doc/qt-4.8/designer-resources.html
I have just finished my C# Windows form program and would like to make a zip file of the binary so others can download it. I checked the bin/release folder, and while I can recognize many files which I know will be necessary, but some other files I am not sure if it is safe to exclude them.
The following files are the ones I am not so sure:
program.pdb
program.exe.manifest
program.exe.config
program.application
ExternalDLL.xml (related to
ExternalDLL.dll which I need to keep,
but is the xml important?)
P.S. I am using VS Express so I have to manually deploy my project.
The short answer is: You don't need any of those, with the possible exception of the .config file. If you didn't store any of the app's configuration in its .config file, then you don't need it either. I recommend excluding all of them and trying your app on a different machine. I expect it'll work fine.
The longer answer is: There's probably individual SO questions about each. For example, here's a manifest/application question: C# - do I need manifest files?
I'm using MSBuild to create a deployment package as part of my build process. I am calling MSBuild with /t:package as part of the command.
This is working great except for two things.
I am using web fonts and it seems that these are not being included as part of the package (they are included in the project). How do I include these fonts?
The folder structure within the zip file is ludicrous - it includes the full path from the drive letter down. I anticipate this could cause problems with the length of path names at some point. Does anyone know how to prevent this? (I know it's a duplicate of this: Visual Studio Deployment Package - change the file structure the .zip creates?)
The reason your fonts (or any other non-standard file) are not being deployed is the "build action" is set to "none". To fix this, select the file in solution explorer and modify the build action to "content". Package your project and it will be included.
I never understood the folder structure either. By using msdeploy to publish the site it uses that folder structure to deploy multiple sites at once. It's annoying when looking at the package itself but it does "work". Also... the max file length is something like 32k characters. See: Maximum filename length in NTFS (Windows XP and Windows Vista)?
There is a way to change the internal path used within the zip:
/p:_PackageTempDir="C:\websites\myNewSite"
The switch can be used on the command line with msbuild to change the path it creates inside the zip. It is also possible to change this within VS but can't remember how off the top of my head.
I have copied a project to a new directory, and now the workspace will not load into the vc++6 ide. There is no error, just no workspace. I have diff'ed the dsw and dsp files, and they are the same.
Well, this is really annoying. The problem turned out to be a CRLF->LF problem in the dsw workspace file. Git had removed CR's and the diff inside of notepad++ showed identical files. Add back the CR's and the workspace now loads into VC6.
Check in the project and solution files with a text editor for any paths that point to files that cannot be found - maybe there is a relative or absolute path that cannot be found?
This problem came up when moving from ide-based development to command-line builds and then back to ide. The dsw and dsp files need to be newer than the source, or else the workspace will refuse to load. Just open the files in a text editor and save them without changes, or use touch.exe, which can be had in UnxUtils from sourceforge.