Sunday, November 27, 2011

Multi Commander v1.2.1

0 Comments
Multi Commander v1.2.1 is released. This release contains mostly bug fixes. Over 100+ changes has gone into this release.

Before I sad that the next update would be a major update. But that version is not quite ready yet and I have fixed a lot of issues in the current version. So before I start to merge in all the new major features into the current version I decided to release this version that has all the latest fixes.
I does have more then 100+ change since v1.2.0 so it contains a lot of fixes.

Enjoy.


Sunday, October 30, 2011

Multi Commander v1.2.1 Build 863 [BETA]

0 Comments
Most of my spare time that I have left, is spent on developing new major feature for the next major version of Multi Commander.
But I do fix bugs and issues for the current version. And I fixed a couple of issue so I decided to release a new beta. So they can be tested.

I also included one minor new feature. Quick Copy, It will create a backup of the file or folder in focus in the same place. But with ".bak" appended to the end of the name.

More information about the beta


Monday, September 26, 2011

Multi Commander v1.2.0

0 Comments
Multi Commander v1.2.0 is released. This release contains mostly bug fixes. Over 160+ changes has gone into this release.

It might take some time until the next version is ready. Because the next version will be a major update with larger new features and new extensions.

There might be a version 1.2.1 before the then, But that will be a release that only fixes bugs and minor problems. No new additions.


Tuesday, September 13, 2011

C++11 Feature support in VC11

0 Comments
Today it was released what C++11 feature that VC11 will support.

The expection was that a lot more would be support. Only 3 new feature sinces VC10.
A lot of people displayd the disapointnemt in the commentsand rightfully so. I think that more could be expected from a company as big as Microsoft.

The the 3 new feature is not everything that is new. If we look at the bright side of things we get more from STL, We get the new AMP that is very intressting, and we get the <filesystem> header from TR2 , that will give us the Boost.Filesystem V2, and that is good.
The new threading support via the <thread> header will be there and that is something I look forward to use.

So even if the new feature for VC11 is not what we expected it is not all bad.

And with the BUILD conference starting today. I expect that we will get lot more news about developing with Windows 8 soon.

Saturday, September 10, 2011

Smart Pointer - unique_ptr

0 Comments
With C++11, There is no reason anymore to use 'delete', and you should try to avoid it.
C++11 gives us a couple of smart pointers, use them and your code will be better and safer.

unique_ptr is the basic replacement for the standard pointer.
It holds a unique pointer and will delete it when it goes out of scope.

If you need to hold multiple instances of the same pointer the you should use shared_ptr instead. But often unique_ptr is enough.

std::unique_ptr<MyClass> pObj(new MyClass);
delete for this will be called when pObj is destroyed.

You then use the pointer as you normal would.
pObj->Method1();
pObj->Method2();

If you need the raw pointer.
MyClass* pRawPtr = pObj.get();
But do not call delete on pRawPtr your self.

If you want to remove a pointer from the smart pointer, you need to release the ownership of it.
pObj.release();
The std::unique_ptr will now not delete the pointer. And pObj is now also invalid for usage.

If you want to move the ownership from own uniqe_ptr to another you need to use the STL helper function std::move.
std::unique_ptr<MyClass> pObj2;
pObj2 = std::move(pObj);

// or you could do
std::unique_ptr<MyClass> pObj2(pObj.release());
Now pObj2 owns it. and pObj does not point to anything anymore.

You should NOT do this. If you do, you will shot yourself in the foot.
std::unique_ptr<MyClass> pObj2(pObj.get());
pObj and pObj2 both owns the same pointer. And it will be deleted twice.

What about arrays?
Arrays must be delete using delete[], and unique_ptr will do that, As long as you defined it with the type.
std::unique_ptr<char[]> pArray(new char[2000]);
delete[] will now be called when pArray gets deleted.

Example
std::unique_ptr<BYTE[]> FileReader::ReadDataFromFile(int nByteToRead)
{
  std::unique_ptr<BYTE[]> pBytes(new BYTE[nByteToRead]);
  ZeroMemory(pBytes.get(), nByteToRead);

  DWORD nBytesRead = 0;
  ReadFile(m_hFile, pBytes.get(), nBytesToRead, &nBytesRead, NULL);
  return pBytes;
}

std::unique_ptr<FileReader> pReader(new FileReader("filename.txt"));

std::unique_ptr<BYTE[]> pData = pReader->ReadDataFromFile(64000);

pReader and pData will be automatically be deleted.

Friday, August 26, 2011

Windows 8 - File Name Conflict Dialog

0 Comments
The Windows 8 team release some video and information about the new and improved copy process in Windows 8. It is really a nice improvement from Windows 7. However not good enough to kill Multi Commander, It will still be needed if you want full control of your files.

A lot of the comments in the Windows 8 file copy post was about the file name conflict dialog.
And today they released a new post ( Designing the Windows 8 file name collision experience ) where they talk about the design decision behind that dialog. It is a simple dialog but it is not an easy task to get it right.

I have some experience with this my self. I been working on a redesign of the file name conflict dialog for Multi Commander, and it is not easy. There should be enough important information so the user can make a good decision. But to much information will make the dialog hard to read. To little and the user might not know what file to keep/overwrite. It hard to make a good balanced decision here.



Tuesday, August 23, 2011

nullptr (c++)

0 Comments
C++11 now finally offers a real null pointer that is type safe.
The old NULL was a define of the value 0, and this is can generate some problems and bugs.

Here is one of the problem that NULL can give you. In this example we got 2 overloads and we want the pointer overload to be called. But if we send NULL to it. We will not get the expected behavior.
void method(int *p);
void method(int n);

method(NULL); // what overload is going to be used. ??
              // method(int n); will be called.

By using nullptr that problem will be avoided.
void method(int *p);
void method(int n);

method(nullptr); // method(int* p); will be called.

Tuesday, August 16, 2011

The Importance of Crash Reporting

2 Comments
One of the most useful feature that I implemented into Multi Commander was that if it crashes it will automatically upload the crash dump to my server.

Of all the crash report I received, I never received a mail or forum post from anyone that reported that it crashed when they did X. If Multi Commander did not send a crash report, there would be a whole bounce of bugs that I would not have been informed about and that would not have been fixed.

Having automatic crash reporting is probably the most important feature you can have. Without it you would not find all the weird problem that user can be affected by.

Sunday, August 14, 2011

Lambda (C++11)

0 Comments
Lambda expression is another new thing in C++11

Lambda expression allow you to create a local (temporary) function. And it works like a function pointer or function object.

They look complex and different, But they are not.
All lambda expression start with a capture clause, Following with parameter list, then return type and last the execution scope. If return type is not specified it will try to figure it out it self or use void.

[]() -> bool { return false; };
(A lambda that does nothing. It just returns false.)

[&nCount](int x) -> bool 
{ 
  if(x) 
    return false; 
  else 
    return true; 
};
(A lambda that capture the nCount variable from local scope as a reference, It will accept a int as parameter and will return a bool )

Friday, August 12, 2011

Multi Commander Free Edition - First Month

0 Comments
I released Multi Commander for free a month ago (12-July-2011).
I did not expect I would get many more downloads. But I got a lot more downloads then I expected.

It hard to tell the exact number of downloads since some sites like download.com / fileforum.com and some other store the file locally, instead of redirect to my site. And some people still use download accelerators and that can gives a incorrect download statistics.

Taking all those factors into account, I still get a number of over 20.000 downloads.

A lot more then I expected.

Thursday, August 11, 2011

auto (C++11)

0 Comments
The new C++11 standard has given us a lot new features. One of them is auto.
auto it is not exactly new, auto was actually already a reserved keyword in C++ but nobody used it. So auto now means something totally different and is now useful.

Sunday, August 7, 2011

First Post

0 Comments
It is not like the world need more blogs about programming. But here it is anyway.

This blog will mostly be about software development on Windows, C++, Debugging, and what else that can be said about it.

Who I'm I?
I'm self though programmer that started with programming on the Commadore C64, and then with C and some assembler on the Amiga 500 a long time ago. Don't remember exactly when, but I got my Amiga 500 around 1989.

I'm been working as a C++ developer since 1997, Currently I'm working as a consultant for Consulence and been placed at a company in Malmö,Sweden for the past few years, There I and a couple of other developers are maintain lots of legacy code, fixing bugs, investigating customer problems, implementing new features and more.

Personal Projects
A lot of my spare time goes into the development of Multi Commander.
Multi Commander is a file manager replacement for Windows Explorer, I been working on that for a long time and it was only available to me and some friends. But recently I decided to release it publicly.