Fenster nicht in UI Thread

…und noch eine Anfrage:

In einer DLL habe ich einen UI-Thread in Form einer CWinApp implementiert - das sollte doch funktionieren ?

#include "stdafx.h"

class CMyWin : public CFrameWnd
{
public:
 CMyWin();
};

class CMyApp : public CWinApp
{
public:
 CMyApp();

protected:
 virtual BOOL InitInstance();
 virtual BOOL PreTranslateMessage(MSG \*pMsg);

 CMyWin \*win;
};

CMyApp::CMyApp()
 : CWinApp()
{
}

BOOL CMyApp::InitInstance()
{
 win = new CMyWin();

 m\_pMainWnd = win;
 m\_pMainWnd-\>ShowWindow(SW\_SHOW);

 return TRUE;
}

BOOL CMyApp::stuck\_out\_tongue:reTranslateMessage(MSG \*pMsg)
{
 return CWinApp::stuck\_out\_tongue:reTranslateMessage(pMsg);
}

CMyWin::CMyWin()
{
 Create( 0, "Hallo", WS\_VISIBLE | WS\_OVERLAPPEDWINDOW | WS\_SYSMENU, CRect(20,20,120,40), NULL, 0, 0, 0);
}

CMyApp theApp;

Wenn ich diese DLL per LoadLibrary (über Button eines anderen Fensters) lade, erscheint das Fenster aus der DLL-App auch ordnungsgemäß. Schaue ich dann mit SpyXX nach, wird das Fenster aus der DLL im gleichen Thread im Prozess aufgelistet, wie das Fenster mit dem Button -> Das sollte doch eigentlich in einem anderen Thread laufen, oder ?

Wo liegt mein Denk- oder Programmierfehler.

Danke, Lars

P.S. Schade, dass die DllMain implizit implementiert ist, sobald AFX included wird !