Visual Studio - Build process optimized for multi processors
0 comments Posted by Just little ol' me at Monday, May 26, 2008
These days, everyone wants to buy state of the art technology when it comes to PCs. Fast processors, lots of RAM, stunning graphics cards, huge hard disk drives, blue ray drives, anything new on the market.
If you are a developer using Visual Studio 2005, you probably want to know how can you truly benefit from all the new hardware while programming your applications.
Well, I am happy to announce (for those of you who did not find out about this until now) that Microsoft has been asking this question for quite a while. When it comes to the RAM usage of Visual Studio, most of you already know that VS 2005 consumes more than VS 2003, but VS 2008 takes it to another level... Especially if you are a Vista user:
| VS Version | Minimum RAM | Recommended RAM |
| 2005 | 192 | 256 |
| 2008 | 384 | 384+ XP 768+ |
Having 2GB + of RAM is nothing our days. Tomorrow, we will probably count RAM using Terra Bytes.
One great thing that Visual Studio 2008 brings for us, developers, is not only compatibility, but also optimization of the build process on multi core processor systems. This basically means more cores = faster build! And that, I must say, is COOL! Imagine using dual Quad processor system for building projects that usually take up to 10 hours to build. That reduces the overall build time to about 12%!!! Nice.
What is NOT nice nor COOL is that this feature was present also with Visual Studio 2005, just nobody informed us! And it so easy to enable it...
The /MP option can reduce the total time to compile the source files on the command line. The /MP option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.
So, just open Visual Studio, open up your C++ project (sorry C# users) -> right-click and select Properties -> in the left tree expand Configuration Properties -> expand C/C++ -> select Command Line. In the Additional options text area, type "/MP" and press OK. That's it, you're all set!
PS: I don't know if you need to restart VS or reboot your computer. It should not, since you are only modifying the command line arguments of the build command. Anyway, if you don't see any results after doing this change, you either did something wrong or need a new processor :P
Labels: microsoft , multithreading , Visual Studio
Clear RAM on Windows XP without reboot
0 comments Posted by Just little ol' me at Monday, May 26, 2008
I found a cool trick that is supposed to free your RAM memory without having to restart the system. I am a little skeptical about it, but I remember using a RAM cleaning tool when I was using only 64MB (a while ago :) ).
Steps to follow:
1. Create a new shortcut on your desktop (locate an empty spot on your desktop, right click on your mouse and select - New->Shortcut)
2. Type “windir\system32\rundll32.exe advapi32.dll,ProcessIdleTasks” without the brackets in the box and click next.
3. Name your shortcut “Clear RAM,” and click finish…. All done!…
Now, when your system slows down just click the clear ram shortcut, and you are back to your normal operating speed.
PS: I searched a few posts about this trick and some people even reported the reverse of this happening. I found some Delphi source code of an application that is supposed to also free the RAM memory of unused items. When I get the chance I will take a look and try to come back with a working solution to free up some RAM...
Windows ONE-Click shutdown and optimization
0 comments Posted by Just little ol' me at Monday, May 26, 2008
When you shut down Windows XP, the OS tries its best to make sure that all services (they help run things like graphics, printers etc) are shut down. But there are times when they don't close, thus Windows XP tries to give it the chance to shut down itself. This amount of time that windows waits for the service to close is stored in the system registry. If you modify this setting, then windows will shut down the service earlier. To modify the setting, follow the directions below:
- Start Regedit.
- Navigate to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control.
- Click on the "Control" Folder.
- Select "WaitToKillServiceTimeout"
- Right click on it and select Modify.
- Set it to a value lower than 2000, say 1000 as a test.
To speed up the shutdown process even more, you can create a one-click-shutdown following these directions:
- Navigate to your Desktop.
- On the Desktop, right-click and go to New, then to Shortcut (in other words, create a new shortcut).
- You should now see a pop-up window instructing you to enter a command line path.
Enter one of these as the path: SHUTDOWN -s -t 01
- If the C: drive is not your local hard drive, then replace "C" with the correct letter of the hard drive.
- Click the "Next" button.
- Name the shortcut and click the "Finish" button.
Now whenever you want to shut down, just click on this shortcut and you're done. Also, if you want to make life better and faster, you can right-click the new shortcut you just made, go to Properties, and type in X (or whatever letter) in the Shortcut Key box.
Outlook - Save Embedded Pictures in Their Original Format
0 comments Posted by Just little ol' me at Tuesday, May 20, 2008
I just found a great post that helped me solve a problem I was having for a long time: how to download inline pictures from an Outlook (2003 in my case) message. If the images are attached, you can just select them all (using the SHIFT key) and copy/paste them in your desired location. But what do you do when you have the images inline (embedded) in the message? Check out the post below. In just 2-3 minutes you will have your problem solved!
I liked the article so much because it is very strait-forward. So I did not do any modifications to it. You can find the original post here: http://www.howto-outlook.com/howto/saveembeddedpictures.htm
I also found a $20 solution for this problem (http://www.ope2000.com/product.htm), so thank you Internet! Here goes:
You’ve probably come across this at least once; You receive a nicely HTML formatted message with embedded pictures so the sender can tell the story with the pictures and when you try to save the pictures you can only save them as a bmp-file. Or; you receive a fun e-mail with an animated gif-file and when you try to save it you can only save or copy it as a bmp-file which will of course break the animation.
This How To article explains how you can save the embedded pictures in their original file format.
- Make sure the Visual Basic editor is installed
- Create macro
- Create a button for the macro
- Using the macro
Since we are going to create a macro from code you must have the Visual Basic editor installed (which is the default). If you don’t have it installed you can install it by Control Panel-> Add/Remove Programs-> select your Office version-> button change. Now setup will start. Here you choose for Add or Remove Features-> Select “Choose advanced customization of applications” (Outlook 2003). In the list you get expand Microsoft Office-> Office Shared Features-> Visual Basic for Applications and set it to Run form My Computer. Press “Update” to install. You might need to insert your CD during setup.

This is where you can find the Visual Basic Editor when you have it installed
As I already provide you with the code, creating the macro is easy. The code has been tested with Outlook 2003 on Windows XP and Outlook 2007 on Windows Vista but should work on previous versions as well.
We start up the Visual Basic Editor by going to Tools-> Macro-> Visual Basic Editor. This will open a new screen. Choose Insert-> Module to create a new module dedicated to this macro. Select the newly created module in the left pane and rename it to “SaveAttachments” by changing the Properties value in the pane underneath. Copy and paste the code below to the module.
Click in the area above and press CTR+A to select all. Press CTRL+C to copy the code

The code copied in the Visual Basic Editor.
Important!
Since this macro also uses Windows functionality to prompt you for a folder location we must add the reference to the project. To do this choose Tools-> References… and select Microsoft Shell Controls And Automation. After this press OK.
Now we debug the code by choosing Debug-> Compile Project1. You shouldn’t be getting errors if you’ve done everything correctly.
If you do get errors retrace your steps and also verify that any previous code you might have in ThisOutlookSession is correct. Debug until you’ve solved the errors (the code provided works correctly without any modifications).
To be able to run the code without setting your macro security level to medium I recommend that you sign your code which is a very easy process and only takes a minute.
Create a button for the macroYou can run the macro through Tools-> Macros… -> select the SaveAttachment macro and then press Run. However the easiest way to access and use the macro is to create a button for it. Since the macro works on the selected item we can create the button in the main Outlook window. Follow the instructions below to create a button.
- Set the Toolbar in edit mode by going to View-> Toolbars-> Customize…
- Select the tab Commands
- In the Categories column select Macros
- In the Commands toolbar click on
Project1.SaveAttachmentand hold down the mouse button. - Drag the icon to a location on the Toolbar so the pointer will loose the cross and release the mouse button to drop it in that location
- Right click the icon to change the name and to assign it a button image you like (if you want to learn more about editing Toolbar buttons click here)
- Press Close to leave edit mode

The Save Attachments icon in the Toolbar. Curious what my Running Man icon does?
Alright, now that we’ve gone through all the trouble we can finally save all types of embedded pictures in their original file format. To do this you select the message that contains the embedded pictures. When you click on the Save Attachments button you’ll save all attachments with a date and time stamp to a folder of choice. Note that it doesn’t save blocked attachments.
Say good-bye to converting bmp-s back to jpg-s and broken gif-s!
Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
The Process Explorer display consists of two sub-windows. The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in: if it is in handle mode you'll see the handles that the process selected in the top window has opened; if Process Explorer is in DLL mode you'll see the DLLs and memory-mapped files that the process has loaded. Process Explorer also has a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded.
The unique capabilities of Process Explorer make it useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.
Process Explorer works on Windows 9x/Me, Windows NT 4.0, Windows 2000, Windows XP, Server 2003, and 64-bit versions of Windows for x64 and IA64 processors, and Windows Vista.
Now here's a little extra trick you can do with the Process Explorer. You can find out what connections an application is using to communicate over LAN or Internet.
Have you ever wondered what IP address one of your YM or Skype friends has? Using Process Explorer you can now find out. Just open PE, find YM or Skype in the process list, double click on it and select the TCP/IP tab. You will now see all active connections for the process that use the TCP/IP protocol. Leave this window open and start chatting with your buddy. You will see the IP address appear (if it's not already in the list) and highlighted. While the communication is in progress, the highlight will be green, then red (communication stopped), and then it will not be highlighted anymore (might even disappear from the list).
You can use the same technique for Internet Explorer, Firefox, or any other application that creates TCP/IP connections.
Happy exploring your processes!


