Website of Markus Griesser


Daily notes



Index of the last 20 entries:
(Click here to see all entries)

Monday, 10 December 2007 - Changes for the admin
Sunday, 09. December 2007 - Reporting back for duty
Monday, 20. November 2006 - Battlefield 2142
Monday, 16. October 2006 - Kim Peek
Thursday, 05. October 2006 - Coding section and VS 2005
Friday, 15. September 2006 - Hotline-Tool Update
Wednesday, 06. September 2006 - Resident Evil on XP :)
Saturday, 26. August 2006 - Hotline Project
Wednesday, 16. August 2006 - Tooltips in modeless dialogs
Monday, 14. August 2006 - Update to CSizingControlBar
Monday, 19. June 2006 - Windows Vista Beta 2 - new infos
Monday, 19. June 2006 - DLL Memory Problem using MFC
Saturday, 10. June 2006 - Windows Vista Beta 2
Tuesday, 06. June 2006 - Footiefox
Tuesday, 06. June 2006 - Misc
Wednesday, 24. May 2006 - Google Code Jam
Friday, 28. April 2006 - Reporting back
Monday, 10. April 2006 - Tweaking Oblivion
Wednesday, 29. March 2006 - C# and Word
Saturday, 11. March 2006 - Call of Duty and cheating



Monday, 10 December 2007 - Changes for the admin

Now I have a login section on the website, where I can add my daily notes online and do not have to use a separate program. Yeah :) It took me quite a while but thanks to SelfHtml and my brother (again) I finally finished it.

top


Sunday, 09. December 2007 - Reporting back for duty


I am so sorry!! For more then a year no changes on the website. Today I completely restructured it and gave it a new design. I hope you like it. Thanks to OSWD and especially Michael O'loughlin for the design.
Currently there are some open tasks for me and not every page is filled as it should be. But I apologize, it's already late. I have reduced the content to my main interrests which I think will lead to better quality and a shorter interval in updates.
Good night!

top


Monday, 20. November 2006 - Battlefield 2142


The reason for my inconsequence with updating this homepage has a name: Battlefield 2142. A friend told me about and so I tried the demo and was simply fascinated. As I never played the older Battlefields, it was a complete new genre for me which has its special flair. Always working in a team, not to mention the complex ways of cooperation possible in this game. It is spreading like a wildfire in my circle of friends. Currently we are four people playing mostly together:
Quixicote (my self)
tuxx-home.at (my brother Alex)
Exitus666 (my friend Christian)
MajorTeder (Alex colleague Tom)


Of course there is a natural rivalry between us, but there is no doubt, that I am the best :)
Maybe I will add some screenshots when there is time in the battle. I would recommend everybody this game, although there are some disadvantages. - The titan-mode lag
when the titan shields are down and the titan is moved for me sometimes impossible to play inside the titan, so I just don't do it.

- Glitches
some player think they are very good if using those bugs. They go through walls and frag you out of rooms you cannot even go to.

- stats padding
if you take a look at the ranking, just ignore the first 2000 - 3000 people. They are cheaters who earn more then 1000 Points a round, which is impossible when playing fair.

- damn teammates
most of the time it is very funny playing in a team. When you are hurt, call for a medic and if he is in a helpful distance, he will heal you. But sometimes they just play for themselves and simply ignore you, when lying head down in your own blood.

Altogether it is one of the best games I have ever played.

top


Monday, 16. October 2006 - Kim Peek


I have written a new story in the discussion section about a man I am really impressed of. His name is Kim Peek and he is a Savant with exciting abilities that makes my faith in the development of mankind stronger than ever.
Coding
Due to personal causes I did not manage to finish my first entry in the coding section this week. As soon as I have time, I will update it. So stay tuned.

top


Thursday, 05. October 2006 - Coding section and VS 2005


Coding:
Today I removed my Linux section and replaced it with a new coding section. It should be a plattform for many different samples, snippets or ideas I wrote or found during work or at home. I think there might be something of interest for other developers. At first I will add my extensions or modifications to some MFC controls I use. At the moment it is quite empty, but during the course of this day I will add the first controls.

VS 2005
I get crazy. I hate it. Since Visual Studio 6 every new release of VS was such a big mistake, I can't stand it. Here is my story of pain, that you can understand me:
Visual Studio 2002 (7.0) & 2003 (7.1):
- Ugly looking interface. Have never seen something like this.
- If you switch to another file in the editor (open), the project tree highlights this file. Sounds good? I would be good, if you can deactivate this feature. So guess 50+ files open and everytime you only take a short glimpse to another opened file, the tree flickers arround. And if you take a look on the tree after 3 hours of working, it looks like Bart Simpson's hair after an electro shock. The next 10 minutes you are busy with clicking on minus buttons...

- Class Wizard has gone. Why? It worked perfectly. The new system is more or less also working but not as good as the CW.
- The compilers. I do not know what Microsoft has done with them. If you started a rebuild all in VS 6, there was no doubt that the compiler is ready after an hour (depending on the project size) if there are no errors. But nowadays it is like a poker game. The compiler works, pokerface (no warnings/errors). Suddenly he complains about some undefined symbols that you did not touch the last 14 days. So what? Is he bluffing? This can't be. Rebuild this project again. Compiler works. Suddenly he is complainig about another missing semicolon. Another bluff? Now I want to see and delete all files in the output directory. Recompile #3. It was a bluff, everything is fine now...

And then VS 2005 came up. All the above mentioned points (except CW) where gone. But there are other problems. The new CW interface for adding messages is not working. Always the same error: Add/Remove operation failed because "foo" is read only. Not a big problem may the hardcore coders say: add your handlers manually. This is a big problem, because of wasting time. So I googled arround and found many people with the same problem. There is a workarround from Microsoft as follows:
1. Close VS 2005
2. Delete the solutions ncb file (Intellisense Database)
3. Start VS 2005
4. Wait for Intellisense to rebuild the database
5. Add your handler
6. goto 1;

Ey guys! You know how long Intellisense needs to update its database in my companies project? 25 Minutes...

Here is my workarround/solution which works for me:
1. Get the Visual Studio 2005 SP1 (beta) - you have to register for it
2. Install this crap (needed 1 hour on my machine)
3. Uninstall Internet Explorer 7 (yes)
4. Have fun

I think Microsoft has tested this software only with a 5 files project. Otherwise I do not now how this has passed the QC. On 11:54:30 I told the new CW to add a handler to my OK button. Now, 11:55:02, the handler is ready. For comparison, VS 6 needed less then 2 seconds in the same project.

Don't ask me why, I am a fool...

top


Friday, 15. September 2006 - Hotline-Tool Update


Today I uploaded a new version of my Hotline-Tool for download. Some improvements and many bugfixes. Here a short list:
- Countries for Customers are filled out of a textfile (countries.txt)
- A setting for choosing a different path for the database
- Special time-license handling such as
-> highliting when time-license becomes invalid
-> searching for time-licenses that expire in x days
- Better license display (less columns)
- Adding comments to licenses

Have fun ;)

top


Wednesday, 06. September 2006 - Resident Evil on XP :)


It is nostalgia, I know, but I played the Resident Evil games years ago with friends on the Playstation and we always had a lot of fun (well, fun might not be the correct word...).
The fact is, that I got Resident Evil 1 and Nemesis for the PC and of course want to play it. Nemesis did not make any problems if you play in windowed mode. Fullscreen is very choppy and slowly and sometimes crashes. Even my new Gamepad works...

Now to Resident Evil 1. When you click on the Setup, it complains about your Windows, because it was designed to only work with 95. But no problem in the first step, we know the compatibility mode of XP. So right click the Setup.exe and select Windows 95 in the compatibility-combo box. Setup starts and a red screen comes up, but nothing seems to happen. The reason is an unvisible dialogbox, which tells you something. Just hit Alt+F4 and go through the setup. Resident Evil then asks you for your graphics card. For me the Rendition-Cards worked fine - I own a GeForce 6600 GT. All 3Dfx crashed.

That's it. Now you can play. If you do not want to insert the CD, just copy the files in the main directory to your installation folder.

One problem is still active: Sometimes I have no sound, but I'm working on it. Today in the evening I will add some pictures that you get an impression :)

top


Saturday, 26. August 2006 - Hotline Project


You can find a new project in the project-section I designed for my company. It is a lightweight database application for handling our licensing system. Of course, the licensing code is not available but the database background.

It's design is abstractive, so I think it can easily be applied for different purposes.

top


Wednesday, 16. August 2006 - Tooltips in modeless dialogs


What is the problem:
If you are working with modeless dialogs and was thinking of adding tooltips to your controls, you must have stumbled over this:

BOOL CMyDialog::PreTranslateMessage(MSG *pMsg)
{
  m_Tooltip.RelayEvent(pMsg);
  return(TRUE);
}


This functions is never called in modeless dialogs, so the normal way of adding tooltips does not work. A real mess if you like tooltips :/ All my searches on the net never revealed any possibility of adding tooltips to modeless dialogs, although I found many threads discussing this problem.

But today I found a good solution that seems to work nearly perfect for me. A short history of possibilities I tried before:
- WindowProc
- OnTimer
- Hooking the Mousemessages


None worked, or had too much overhead. The working solution:

LRESULT CMyDialog::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
  MSG Msg;
  if(PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE)){
    m_Tooltip.RelayEvent(&Msg);
  }
  return(CDialog::DefWindowProc(message, wParam, lParam));
}


Why is this solution working?
At first, DefWindowProc is always send (except you do not forward a specific task). The next good thing with this is, that you also get notified when the mouse is over a child control (what WindowProc for example does not). And finally PeekMessage tells me what message exactly was sent. Do not forget to call PeekMessage with the PM_NOREMOVE parameter. Otherwise your dialogs will behave - let's say - strange :)

top


Monday, 14. August 2006 - Update to CSizingControlBar


I found a nice control named CSizingControlBar on CodeProject which I needed for my newest project. The original author is Cristi Posea. Writing those things manually is always a waste of time, but that is another story :)
Finally it did not meet my requirements, because it only allowed one control in the ControlBar. So I decided to improve it by allowing multiple controls which are sized correctly. Here is a picture of what it could before:
sizebar

Due to the reason the OnSize function of the CSizingControlBar is not working as every other (e.g. a Dialogs) OnSize function, it was a bit tricky to get it work. The code is quite quick and dirty, so everyone is invited to improve it :)

Before:

void CSizingControlBar::OnSize(UINT nType, int cx, int cy
{
   UNUSED_ALWAYS(nType);
   if((m_dwSCBStyle & SCBS_SIZECHILD) != 0){
     // automatic child resizing - only one child is allowed
     CWnd *pWnd = GetWindow(GW_CHILD);
     if(pWnd != NULL){
       pWnd->MoveWindow(0, 0, cx, cy);
       ASSERT(pWnd->GetWindow(GW_HWNDNEXT) == NULL);
     }
   }
}

As you can see, the control is always streched to the ControlBar's size and the code makes an ASSERT when more than one child is added.

My changes:
At first I designed a structure to tell the CSizingControlBar what to do with more than one control.

struct TChildSizing{
  TChildSizing(){
    nDistanceLeft = nDistanceRight = nDistanceBottom = nDistanceTop = 0;
    sizeLeft = sizeRight = sizeBottom = sizeTop = eChildSizeParent;
  }
  enum EChildSizing{
    // Point has to be set to the parents appropriate point
    eChildSizeParent,
    // Point has a fix distance to the child's opposite point
    // e.g. top to bottom, left to right
    // the appropriate nDistance* variable has to be set
    eChildSizeFix,
    // Point has a distance to the parents point
    // the appropriate nDistance* variable has to be set
    eChildSizeDistance
  };

  int nDistanceLeft;
  int nDistanceRight;
  int nDistanceBottom;
  int nDistanceTop;

  EChildSizing sizeLeft;
  EChildSizing sizeRight;
  EChildSizing sizeBottom;
  EChildSizing sizeTop;
}


Now I added two new variables (of course, a Map would also do).

CArray <CWnd*, CWnd*> m_caChildWnd;
CArray <TChildSizing, TChildSizing&> m_caChildSize;



Those variables hold the rules for resizing the control pointed to by the CWnd pointer.
Tow new functions:

bool CSizingControlBar::GetSizeForChild(CWnd *pWnd, TChildSizing &size);
void CSizingControlBar::AddChild(CWnd *pWnd, TChildSizing size);



Now you can define your controls as follows (in OnCreate of your derived class):

if(!m_EditCtrl.Create(WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_WANTRETURN,
    CRect(0, 0, 0, 0), this, 123))
    return(-1);
TChildSizing size;
size.sizeLeft = TChildSizing::eChildSizeParent;
size.sizeBottom = TChildSizing::eChildSizeParent;
size.sizeRight = TChildSizing::eChildSizeDistance;
size.nDistanceRight = 60;
size.sizeTop = TChildSizing::eChildSizeFix:
size.nDistanceTop = 20;
AddChild(&m_EditCtrl, size);

// And so on for every control

The result you can see in the following pictures. I have added three controls. A button which is always at the right bottom. A listctrl which is always top and resizes itself and a editctrl which is on the bottom but resizes horizontically.
pro1
pro2

At last I have to say, that I want to inform the author, but his website was last updated in 2002, so I will tell the CodeProject people of my changes and link to this site.

You can download the updated source-code here.

top


Monday, 19. June 2006 - Windows Vista Beta 2 - new infos


After nearly two weeks of Vista on my computer I can draw a first summary. I am still very satisfied with it but some things should be subjects to change by Microsoft:
- Long booting time (nearly 4 minutes until completed)
- Some crashes with games (NFS:Most Wanted sometimes crashed for example)
- Much too strong restrictions with the User Access control (I turned it off)
- Heavy memory consuption of dwm.exe (which makes the cute UI) > 77 MB of RAM and 120 MB of Pagefile
- some unexplainable lockdowns during work (which mostly occurs while network intensive programs run)
- Very bad Startmenu when opening All programs (see picture) This has to be changed, please! It is useless...
vista-menu

top


Monday, 19. June 2006 - DLL Memory Problem using MFC


Maybe this topic is not of common interest for most of the people, but is very important for me. Since we are programming an AutoCAD extension in my company we have a DLL only project with no designated executable file. Because of the needed compatibility on two plattforms we designed some abstraction layers, resource only DLLs and so on... To cut this long story short, one of our main problems was a debug assertion and after this a memory exception, only with MFC classes such as CString. A short overview: Main-DLL (ARX): Fully debug build, linked with standard-libs and ARX-libs.

extern __declspec(dllimport) void DLLCall(CString &s);

void FunctionMain()
{
  CString s;
  DLLCall(s);
}

Extension-DLL (MFC): Fully debug build, linked with standard-libs.

extern __declspec(dllexport) void DLLCall(CString &s)
{
  AFX_MANAGE_STATE(AfxGetStaticModuleState());
  s = "A very long string, that forces the operator to realloc the CString";
}

So, when DLLCall is called out of FunctionMain(), the debug assertion comes up whet the auto variable s is freed by its destructor. So why? It is in principle no problem when the internal memory of the CString variable is allocated on the heap of the Extension-DLLs, despite it was firstly created on the stack of the Main-DLL.
But it is very important that both DLLs are dynamically linked to the MFC DLLs. Up to now I could not track down the problem to this simple fact of linking MFC.
As you might guess - I am happy :)

top


Saturday, 10. June 2006 - Windows Vista Beta 2


Yesterday I downloaded the official Beta 2 ISO for Windows Vista. Because I do not want to try it in a virtual machine and do not have enough space left on my disks for a seperate partition I upgraded Windows XP. Well, dangerous as mentioned in several newsgroups, but I tried it.
Now, after nearly 2 hours of installation, it is finished and working. Very nice Desktop and some interesting tools. Though it is sometimes a bit slow, my first impression is very positive. The Upgrade Adivisory Tool warned me that Vista does not have the drivers for several of my devices, but for my big suprise everything worked fine after the last restart.

Here is a list of some really nice things in Vista:
- NEW VERSION OF MINESWEEPER - really nice :)
- Cool interface, Aero really rocks
- Good features for searching inside of explorer windows (at last)
- Easy navigation in explorer windows
- Windows Defender

A new gallery is available with some nice screenshots.

top


Tuesday, 06. June 2006 - Footiefox


I am normally not very interested in soccer, but when there are events such as WM or EM a strange fever overcomes me. These events have a special flair and so even I become a fan. To be uptodate while in work I installed a special extension called Footiefox - Website It is not only useful during the WM (well, for me it is only useful during the WM), but also with regular matches. Footiefox supports many different leagues in many countries (even Austria - did not know that anybody else is interessted in austrian soccer). I only added the Worldcup as you can see on the screenshot.

footiefox

With Footiefox I always know what is going on in Germany ;)

Warning
Some people reported strange behaviour of Firefox (1.5.0.4) when this extension is installed. I personally did not have any problems. So, if your Firefox is not working as expected, try to uninstall Footiefox.

top


Tuesday, 06. June 2006 - Misc


Short info on Googles Code Jam: I did not advance. Maybe the missing second task is a reason for this...
Firefox - Bon Echo
A new version of Mozilla Firefox - codename Bon Echo - is released. It is currently in beta-stage and only intented to be used by enthusiasts or testers. I count myself to the first category, so I downloaded this piece of software. At a first glimpse, not so many changes can be found, but on the other hand, its design is nearly perfect. But underneath the UI many improvements were made. To view the changelog, follow the link. The downloads are also on the above mentioned webpage.

Give it a try. I already did so. You can find some screenshots in the gallery.

top


Wednesday, 24. May 2006 - Google Code Jam


A few weeks ago I signed up for the Google code jam, a competition for coders in several steps. I nearly forgot that the qualification round started yesterday, so I was a bit stressed starting coding at 23:00 after a hard day of work. After my login I completed two of the tree trainig exercises (250 and 500 Points) earning approximatly 600 Points. I do not really know how points are counted but the time is of course a main cause. In my opinion not the best method, because good coding is not only defined by speed, but by performance and reusability. But reusability is hard to measure for a program :) So I started the competition. I had to solve two problems (250 and 500 points) in 1 hour. My first fault was to believe that I have 1 hour for each problem. I recognized it when starting the second one - 5 minutes are much too less for even understanding what they what...
The description was in english and they where throwing around whith foreign words. As you might guess, I did not complete the second one. At the moment I do not know if I advanced to the second round. Still waiting for an email.

I choosed to write my code in C++. Java and C# where also available but I sticked with the language I can best.

top


Friday, 28. April 2006 - Reporting back


After quite a long time without any changes to my website, I am reporting back for duty :)
The last week I was in Frankfurt at the "Light and Building" fair. My company was presenting our product at the ACS, which was part of the Light and Building. We were placed in hall 9.2. It was a very interesting week, but because of the preperation stress and the journey to Frankfurt (750 km with the car!) I had less time for my website.

A new section
I added a new section to the website, which will contain all my Linux related stuff. Starting with my hardware issues, up to anything cool in Linux (well, there are a lot of cool things in Linux).
At first: Everything is running fine - thanks also to Alex (as ever) I am running a Debian system with Gnome 2.14. More detailed information can be found in the section.

Preparing a new discussion
I am currently preparing a new discussion about "Das Rätsel ICH". As you might guess, a new article in Spektrum der Wissenschaft. So stay tuned...

top


Monday, 10. April 2006 - Tweaking Oblivion


Today while surfing I found a nice link to an Oblivion-Tweak article where many performance and graphics tweaks are described. Also some really nice mods are available such as an improvement of the user-interface which is very helpful. I tried some of the modifications especially the high-res textures. Now resting for a while and taking a look arround is eyecandy :) Of course, most of the tweaks are for high-end computers, so you will have to test it for yourself if the game is still playable.

I also added some screenshots - after my tweaks. So check out the gallery. Link: Optimising Oblivion 2.0

Have fun playing!

top


Wednesday, 29. March 2006 - C# and Word


Today I finished a project for collecting addresses in C#. It has an easy to use interface and prints lists an mailmerges (Serienbriefe) with Microsoft Word. While googling for needfull help I stumbled arround on many websites but found no really solution for the mailmerge problem with a Microsoft Access database. So I would like to provide my code to you:
(The Application-Object and the Document-Object should be filled before)

Word.MailMerge wrdMailMerge;
string sFileName = "db.mdb";
object oFalse = false;
object oMissing = Type.Missing;
// Do not forget the [ and ] arround the tablename
string sql = "SELECT * FROM [Tablename]";
doc.MailMerge.OpenDataSource(sFileName, ref oMissing, ref oMissing,
   ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, 
   ref oMissing, ref oMissing, ref oMissing, ref sql, ref oMissing, 
   ref oMissing);
   
wrdMailMerge = doc.MailMerge;
wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument;
wrdMailMerge.Execute(ref oFalse);

wrdMailMerge = null

That is it. You can prepare a Document with the ColumnNames you need to be filled and open it before using the above function (doc-Object should point to it).

Check out the program in the projects-section.

top


Saturday, 11. March 2006 - Call of Duty and cheating


Everyone thinks of it, but no one owns it for sure: cheating in Call of Duty 2! Maybe you know this situation:
you are playing good, getting many frags and points, but there are always people that are much better. Those with a frag/death ration of 100/2 or something similar. It doesn't matter how good you are playing they are always first ranked. I do not know why those people do that. Maybe they are loser in real life and hope the the other Call of Duty players create a shrine for there being so divine in game. Today I made a screenshot of a Call of Duty loser, while cheating, his name is SuperSlick:
cod_cheat

As you can see, him tumbling around in regions, where nobody ever has been :)

top