The resource editor keeps wiping out code of this form in my .rc:
#ifndef V2
IDB_SPLASHSCREEN BITMAP "res\\xyz v1.bmp"
#else
IDB_SPLASHSCREEN BITMAP "res\\xyz v2.bmp"
#endif
Anyone know of a workaround? Better way to accomplish the same?
MFC projects in Visual Studio normally contain a .rc2 file, which is intended for user-defined resources. If you add your bitmap resources to this file, they won't be modified by the Visual Studio resource editor.
You can read more about this here, and there's some good information in the answers to this question here on StackOverflow.
Related
Intellisense working when I open a tag
But I want to use Intellisense without opening a tag. Like in the picture.
I am able to do this with ctrl + Space combination. Is there any way to do it automatically?
I think you cannot get what you want so far. And XAml Intellisense is special and it should work with < and >. So invoke the Intellisense should be with them. There is no such automatic way as you wished by default.
After all, it is not the type of c# or c++ code that can type some word to invoke Intellisense. And Xaml Intellisense is not flexible as you expected.
VS does not design that by default and there is no such vs extensions I found to realize so far.
If you still want your feature, you could suggest a feature on the DC Forum and then share the link here when you finish it. Anyone who is interested in it including us will vote it to help get the feedback from the Microsoft as soon as possible.
In Solution Explorer, Right click -> Add... Icon file.
The file gets created, but looking at it in Visual Studio, it is uneditable. It includes multiple mips. If you open in external editor, it opens paint. If you then make changes and save it, it asks to save it elsewhere and doesn't affect the original ico.
The thing is, I'm sure this has worked for me before. I'm just not sure what's happening now. Can anyone enlighten me?
The issue you're experiencing is that Visual Studio does NOT know how to edit PNG targets - even though it adds them to your ico by default.
You'll notice that if you have the image edit bar up, you can in-fact edit the BMP target ones (including pasting over from a more capable image editor 😀). Further oddness on visual studio's part, you don't appear to be able to add back the PNG targets, so if you delete them they're gone forever unless you have an external ICO editor (which I assume would mean you wouldn't be using the VS one anyway).
Your best bet if you're committed to continuing in VS (several free websites available that will do this for you given some images) is to clear out the unused versions, and add BMP targets for the sizes you care about. The max for BMP is 24 bit, so be aware, but you should be able to keep a fair amount of fidelity, and still keep your transparency (there is a transparent color, and if you paste in with transparency the editor will automatically fill that in for you) - all while keeping the same sizes as the PNG targets.
Hope that helps!
I'm trying to create an About box for my Windows C++ application. In Visual Studio 2008, I'm using the dialog editor to design the dialog. I want the About box to display the application's version in a static label.
I can hardcode the version into the dialog, stored in a .rc file, but then I'll have to remember to update the version in multiple places.
My application version is #defined in version.h as APPLICATION_VERSION. The resource editor can be convinced to put
#include "version.h"
at the top of the .rc file, so I have access to the APPLICATION_VERSION symbol.
However, I cannot use this symbol from the dialog editor. I can edit the .rc file by hand, replacing the hardcoded version string by the symbol APPLICATION_VERSION. That works fine until I edit the dialog in the dialog editor again: upon saving the .rc from the dialog editor, the symbol gets overwritten with its current value.
Of course, I can set the version label to some dummy text, overriding that text when I receive WM_INITDIALOG, but that feels very clunky and unnecessary. Is there any other workaround that allows me to keep the application version in a single place?
The way I do this is to put the resource in a separate file with a .rc2 extension, and #include that into the .rc file (like you're doing with your version.h). I then edit the .rc2 files with a normal text editor, not the Visual Studio resource editor.
That system's not too bad for VERSIONINFO resources, which is what I use it for, but I can see it would be more of a pain for dialog resources. I'd love to hear of a better way, but I don't know of one.
I want to be able to edit an image (png file) from the resources folder of one of my projects in VS2008. But the resource editor in VS will only allow me to zoom in and out. As the images are 32 bit, VS also will not allow me to use the image editor toolbar to change this. I would like to know if anyone knows how i can edit the image via VS or an associated plugin that is safe to use with source control?!
Thanks in advance guys!
I'm unsure if VS has any built in image editing applications that meet your needs. However, for editing our image resources I've set it up so that the default application launched when selecting certain filetypes is Photoshop (or a different editor depending on the change required).
Changing the default opened program for a filetype can be done using the following steps:
http://msdn.microsoft.com/en-us/library/hy2sthf1.aspx
As for source control safety, I use AccuRev with the AccuBridge plug in for VS. So anytime any of the files under source control are modified it is noted as such. Then these files can be committed as required either through VS AccuBridge plug in or through the regular source control client.
I don't think the VS resource editor supports editing PNG files (see this related question).
I'm not sure what you mean by "safe to use with source control" -- any image editor should fit the bill. Check out the file, locking it if necessary, then edit it with your favorite image editor, such as GIMP. When you're done, check in.
I have to turn in a hard copy of some code with an assignment. Is there any way in Visual Studio 2010 to print C# source code with syntax highlighting?
PS: The assignment is solving a math problem, so the choice of language isn't important and the teacher doesn't need to compile and run the program. She just wants to see our approach and results.
There is an extension now :) Visual Studio 2010 Color Printing Extension
Works well! :)
The best way I've found to accomplish this is to copy from Visual Studio and paste into something like MS Word or OpenOffice Writer.
This gives you full source code, with syntax highlighting. You can then print from Word (including adding your intro documentation before the code, etc).
Just to let everyone know, unfortunately printing in color was cut from Visual Studio 2010 because of resource constraints. Since we've rewritten the editor from scratch in WPF, we didn't have time to reimplement everything so we had to sacrifice this feature. We will try to implement this in the next version of Visual Studio. For now, copy to clipboard and paste into other app such as Microsoft Word is the recommended solution for printing code with color.
If you go to Tools -> Options -> Environment -> Fonts and Colors you can change settings to print with syntax highlighting (change 'Show settings for' dropdown to 'Printer'). But you will need to change all the individual settings to match your IDE (I don't know of a way to make it automatic)
Edit: you can use that "Use..." button next to the dropdown to copy settings from the Text Editor
Simplest of all copy code to clipboard and paste into MS-Word is the way I do and it works...
Have a look at VS.NETcodePrint 2010 availabe from www.starprinttools.com. You will be able to print and export the color coded output to PDF.
Joginder Nahil
Due the fact MSVS does not support it anymore I think the best way is really to copy the code and paste it into WinWord.
The advantages are listed below. You can
set the font/size exactly how you want it.
set the format of line numbers.
have your own header/footer.
remove #region from printing.
add a watermark to the output.
For me - I print once in 2 months a source code - it is a very comfortable way which I never could achieve with any 3rd party extension.