Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Get associated file icon with only extension name using C++ on Windows

I have searched on Google for a few examples on how to get associated file icon with only file extension name using C++ on Windows. There are some useful information provided on MSDN which explains the use of SHGetFileInfo() function.It also gives an example code, but it doesn't say how to do it with only the extension name.  Here I give an example code on how to achieve this after I gathered and summarized some  useful information from Internet. I have tested the code on my PC, it works fine./* * @method * getFileIcon() * @param * int : icon type--FILE_ICON_SMA...

13,997 0       WINDOWS C++ FILE ICON ASSOCIATION EXTENSION NAME


  The mystery of Duqu Framework solved

The Quest for IdentificationIn my previous blogpost about the Duqu Framework, I described one of the biggest remaining mysteries about Duqu – the oddities of the C&C communications module which appears to have been written in a different language than the rest of the Duqu code. As technical experts, we found this question very interesting and puzzling and we wanted to share it with the community.The feedback we received exceeded our wildest expectations. We got more than 200 comments and 60+ e-mail messages with suggestions about possible languages and frameworks that could have bee...

18,373 1       C++ DUQU CODE MYSTERY OO C


  sorting in C++: 3 times faster than C.

If you don't know C++ well, you might be surprised how fast C++ can be sometimes. This is especially true when code involved is small, because then inlining - which is what C++ is very good at - and templating, which makes excessive inlining possible in the first place - has the most effect.The following code compares C and C++ sorting:  #include <iostream>#include <algorithm>#include <vector>#include "stop_watch.inl" // see https://gist.github.com/2057981#ifndef COUNT#define COUNT 100000000#endifint compare_int(const void* p1, const void* ...

3,901 0       C C++ EFFICIENCY FASTER SORTING


  Set Theory in C++11

Have you ever felt the need to perform set theoretic operations on types? Not really? Me neither, but I thought it’s a fun thing to try out. So, if you ever feel the need of using type sets, C++11 makes it quite easy to do so. Especially variadic templates allow for a much more condensed syntax compared to type list constructs formerly used. (Disclaimer: This is rather a proof of concept, but maybe somebody comes up with a useful scenario.)Let’s start by defining an empty type_set type:template<typename ... Types>struct type_set; typedef type_set<>...

2,733 0       C++ SET THEORY MATH


  Custom C++ exception class creation

In standard C++, we can use try catch to catch and exception when something goes wrong. These are some built in exception support in C++. By including the #include , we can now catch exceptions in C++ programs. This actually helps us on debugging our code and reduce the maintenance work.However sometimes if we want to create our own custom exception class. What should we do?We should include the #include line and then extend the exception class and implement some methods as you like. The general format is :#include using namespace std;class MyException:public exception{public:  &nbs...

31,471 2       C++ IMPLEMENTATION STD EXCEPTION CUSTOM EXCEPTION


  QScrollArea Scrollbar Display Solution

Qt framework is a popular C++GUI framework developed by Nokia. And it is also cross platform compatible. Manydevelopers are using Qt to develop C++ GUI programs. In Qt, some importantcomponents are deserved our close attention. Many developers faced the problemwhen they put some widgets in a QScrollArea widget and they want it to displayscroll bars when the widgets inside the QScrollArea overflows. After manyexperiments, I propose a way which can show scroll bars as you expected. The relationship betweenwidgets and layout is the key here. Generally, we need not to add layout toscroll area dire...

16,574 3       C++ SOLUTION GUI QT QSCROLLBAR SCROLLBAR NOT DISPLAY


  Getting started with WTL on Visual Studio 2010

Now that you have downloaded the latest WTL release (v8.1 at the time of this writing), you will find out that it doesn’t have any project wizards for Visual Studio 2010. That’s a relatively easily fix. Just go ahead and download the latest build from the repository at AppWiz.tar.gz-view=tar. Extract the .tar file and you will find the JavaScript install scripts for VS 2010:I recommend you to extract the files to the same location were you installed the WTL files. In my case this would be c:\WTL.  Double click the setup100.js file (or setp100x.js for Visual Studio 2010 Expre...

4,800 0       WINDOWS C++ VS2010 WTL CONFIGURE


  Make a directory using C++ for windows

If you want to create a folder at windows using c++/cpp language, there is an easy way for make a folder. You can do it just including the <windows.h> header file. To make a folder at C:\ drive named "deadman"#include<windows.h>int main(){   CreateDirectory ("C:\\deadman", NULL);   return 0;}If you want to delete a fodler from the C:\ directory.#include<windows.h>int main(){   RemoveDirectory("C:\\deadman");   return 0;}Also you can use the system command from c++ to create or delete a fodler. for examplesystem("mkdi...

16,823 1       WINDOWS C++ EXAMPLE DIRECTORY CREATEDIRECTORY