Sent Items in Outlook 2011 with Exchange and POP3

Today I needed to resend an email I sent a day before – using Outlook 2011 for Mac. It took a while to compose this email so I got quite scared when I looked at my “Sent Items” folder and the mail wasn’t there.

My situation: I’m using an Exchange mailbox is primary mailbox and have a POP3 account for my university email address. The latter I only use to send emails (as the actual university email address is just a forwarding). If you have a similar setup and problem, read on.

On Outlook for Windows, sending an email through this email address/account, moves the sent email to the main “Sent Items” folder – which at the same time is the “Sent Items” folder for my Exchange mailbox.

Not so on Outlook for Mac. Here we have a separate “Sent Items” folder for POP3 accounts (called “On my computer”). I had this folder disabled since (I thought) I only use my Exchange mailbox. The option hide/show this folder is in the preferences under “General”. (I only have the German version of Outlook, so screenshots are in German only; sorry for that.)

Option to show or hide the "On my computer" folder(s).
Option to show or hide the "On my computer" folder(s).

Now the “On my computer” folder showed up in my “Sent Items” folder and there my mails were.

Sent items on my computer folder
Sent items on my computer folder

Now, the quest at hand was: How do I get my sent mails into my “Sent Items” Exchange folder. The solution: Create a rule for this.

So, I went to “Settings” –> “Rules” and created a new rule in the “Outgoing” rules section.

Creating a local rule
Creating a local rule

Here you create a rule with:

  • Condition: Account is YourPop3Account
  • Execute: Move message to “Sent Items (Exchange)”

Leave the rest as it is and hit “OK”. Now try to send an email from your POP3 account and, voilà, the email you just sent should appear in your Exchange’s “Sent Items” folder.

Assign DNS name to virtual machine (here: Parallels Desktop 7)

Assigning a DNS name to a virtual machine can be a convenient thing. Do this is not very complicated, it requires some technical skill though. This tutorial shows how to do this with a Ubuntu 11.10 Linux server running under Parallels Desktop 7 on Mac OS X Lion. The basic principals described in this article work as well for any other combination, but that’s beyond this article (and that’s where your technical skill comes into play).

Read more →

Editing hidden and locked files on Mac OS X with TextWrangler

Sometimes one needs to edit a system configuration file on Mac OS X. While these files are usually text files, you can’t used Mac OS’ “TextEdit” tool to do this. Fortunately, there is a free alternative to “TextEdit” called TextWrangler.

Important: Make sure that you don’t use the AppStore version as this version doesn’t allow editing locked files. (Apple’s store guidelines prohibit this.)

First, select File –> Open... from the menu. Then, since system configuration files are often hidden or in hidden folders, select Show hidden items at the bottom of the “Open” dialog.

Open Dialog in TextWrangler

Then open the file you want to edit. You may notice that the file is in read-only mode (represented by the icon in the upper left corner).

TextWrangler in read-only mode

To switch to write mode, either click this icon or start editing the file’s content. In both cases you’ll be asked to unlock the file. After that, you can edit the file.

When you’re done, simply save the file. You’ll be asked for your password since you’re editing a system file (that doesn’t belong to you). And that’s it.

Note: The AppStore version doesn’t ask you for your password but instead asks you to save the file under a different name.

Microsoft Epic Fail – Eine Odyssee

Manchmal nervt Programmieren einfach. Da hat man folgende Zeile in C++ (bääääh):

PathOption test = mQ1Settings->WorldDir;

Versucht man diese mit Visual C++ 2010 zu kompilieren, stürtzt der Compiler ab. WTF?

Ok, kann ja mal passieren. Also danach gegoogelt. Zu dem Problem gibt es auch schon einen Bug-Report bei Microsoft. Allerdings meint der Verantwortliche dazu:

I can confirm that this is a bug in our compiler. This crash is unfortunate, but … blablabla …, we believe that this is not critical to fix in the next release.

Ein Compiler-Fehler ist “not critical”???

Nach diesem Statement folgt dann noch:

We will keep this bug in our database and will reconsider it for future releases.

Aja. Deshalb hat der Bug-Report auch den Status “Geschlossenes als nicht lösbar”. Klingt natürlich total danach, dass man sich damit später noch mal befasst.

Na gut. Zum Glück gibt es ja die Möglichkeit, seinen eigenen Senf zu dem Bug-Report abzugeben. Dafür muss man sich zwar registrieren, aber einen Account bei Microsoft’s Bug-Tracker könnte man ja evtl. häufiger gebrauchen

registrieren.png

Also schnell auf “Registrieren” geklickt, irgendwelchen AGBs zugestimmt, und dann das:

registrieren-fehler.png

WTF? Das ganze noch zwei Mal probiert, mit dem gleichen Ergebnis.

Schon sichtlich genervt, gebe ich der Sache noch eine Chance. Zum Glück kann man ja Microsoft “hierüber einen Fehlerbericht” senden. Also klicke ich auf den Link, mit der Erwartung, dass Microsoft jetzt über diesen Fehler benachrichtigt wurde. Aber Pustekuchen!

msdn-forum.png

Ich lande in einem MSDN-Forum (mit dem viel-sagendenden Namen “MSDN, TechNet, and Expression Profile and Recognition System Discussions”).

Jetzt reicht’s mir. Wie oft will mich Microsoft denn noch auf eine andere Seite weiterleiten?? Ich wette, ich kann mich auch im MSDN-Forum nicht registrieren (hab ich allerdings nicht probiert). Dann darf ich am Ende einen Bug-Report (Forum) über einen Bug-Report (Microsoft’s Bug-Tracker) über einen Bug-Report (C++ Compiler) schreiben? Nein Danke!

Und dabei wollte ich doch einfach nur programmieren. Danke, Microsoft!

Update (22.6.2011): Das Problem besteht immer noch. Und ich habe inzwischen das Forum ausprobiert; wie erwartet tritt der Fehler hier auch auf, d.h. ich kann nicht mal einen Fehlerbericht im Forum schreiben. Das ist echt ne schwache Leistung, Microsoft!

C++ and virtual methods (for C# or Java programmers)

Last friday I stumbled over a seroius shortcomming of C++ (compared to C# or Java) I’d like to share here with you. It’s about virtual methods called from a class constructor.

The C# Example

Let me start with an example. Here’s some C# code that simply calls a virtual method (named test()) from the class’ constructor:

class TestBaseClass {
  public TestBaseClass() {
    Console.Write("From base class: ");
    test();
  }

  protected virtual void test() {
    Console.WriteLine("in base class");
  }
}

Creating an instance of this class results in nothing special:

From base class: in base class

Now lets create a sub class of TestBaseClass and override the virtual method:

class TestSubClass : TestBaseClass {
  public TestSubClass() {
    Console.Write("From sub class: ");
    test();
  }

  protected override void test() {
    Console.WriteLine("in sub class");
  }
}

Now, creating an instance of TestSubClass will print this:

From base class: in sub class
From sub class: in sub class

This means that the sub class’ implementation of test() was executed (and not TestBaseClass‘ implementation) – just as expected.

Note: In Java all methods are automatically virtual. In contrast to C# or C++ you can’t create “non-virtual” methods in Java.

The C++ Problem

And exactly here is the problem in C++. Let’s create a C++ version of the two classes above (compiled with Visual C++).

Header file (TestClass.h):

#pragma once

class TestBaseClass {
public:
  TestBaseClass();

protected:
  virtual void test();
};


class TestSubClass : public TestBaseClass {
public:
  TestSubClass();

protected:
  virtual void test();
};

Source file (TestClass.cpp):

#include "TestClass.h"
#include <stdio.h>

TestBaseClass::TestBaseClass() {
  printf("From base class: ");
  test();
}

void TestBaseClass::test() {
  printf("in base class\n");
}


TestSubClass::TestSubClass() : TestBaseClass() {
  printf("From sub class: ");
  test();
}

void TestSubClass::test() {
  printf("in sub class\n");
}

Now, creating an instance of TestSubClass results in the following output:

From base class: in base class
From sub class: in sub class

Note how the base class’ implementation of test() is used in the base class constructor while the sub class’ implementation of test() is used in the sub class constructor.

The problem here (in constrast to C# or Java) is that the sub class constructor hasn’t been executed yet and therefore the “redirection” from TestBaseClass::test() to TestSubClass::test() hasn’t been established yet.

Rule: There is no way to call a sub class’ implementation of a virtual function in the base class constructor!

The problem becomes even more severe with pure virtual (which is abstract in C# and Java) methods. These methods don’t even have an implementation in the base class and therefore can’t be executed at all.

For your interest: A C++/CLI class will behave like a C# class (and not like a C++ class).

Example Visual Studio Solution

I’ve created a solution (for Visual Studio 2010) containing the source code above. In addition to a C# and a C++ project, I’ve also added a C++/CLI project. You can download it here:

VirtualMethodTest.zip