Ups, I've done it. It's fubar [1] now.

However it's possible to send an error report using the errorreport switch: csc *.cs /errorreport:prompt

Actually I found why the compiler screw up. I use a lot of plattform invokes and because I am lazy I use a constant with the library name.

private const string LIB = "MyNativeDll.dll";

[DllImport(LIB)]
//...

While changing the code, I removed the const modifier by accident, which causes the compiler to fail...

[1] dict.tu-chemnitz.de
[2] msdn.microsoft.com

Posted at Tuesday, July 12, 2005 1:39:10 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

If you write managed code using P/Invoke, sometimes you have to handle structures returnd by the called methodes. These MSDN articles about marshalling structures [1] and the StructLayoutAttribute class [2] should provide enought information to do so.

[1] msdn.microsoft.com
[2] msdn.microsoft.com

Posted at Tuesday, July 12, 2005 11:18:47 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

This table took me a few minutes, but will save me hours.

Windows Data Type .NET Data Type
BOOL, BOOLEAN Boolean or Int32
BSTR String
BYTE Byte
CHAR Char
DOUBLE Double
DWORD Int32 or UInt32
FLOAT Single
HANDLE IntPtr, UintPtr or HandleRef
HRESULT Int32 or UInt32
INT Int32
LANGID Int16 or UInt16
LCID Int32 or UInt32
LONG Int32
LPARAM IntPtr, UintPtr or Object
LPCSTR String
LPCTSTR String
LPCWSTR String
LPSTR String or StringBuilder*
LPTSTR String or StringBuilder
LPWSTR String or StringBuilder
LPVOID IntPtr, UintPtr or Object
LRESULT IntPtr
SAFEARRAY .NET array type
SHORT Int16
TCHAR Char
UCHAR SByte
UINT Int32 or UInt32
ULONG Int32 or UInt32
VARIANT Object
VARIANT_BOOL Boolean
WCHAR Char
WORD Int16 or UInt16
WPARAM IntPtr, UintPtr or Object
Posted at Monday, July 11, 2005 11:35:25 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

I found a blog entry written by the C# Team, about how to to update user interface from a thread that did not create it [1]? This blog about C# questions could be really awesome, but unfortunately the entries are once in a blue moon.

[1] http://blogs.msdn.com/csharpfaq/archive/2004/03/17/91685.aspx
[2] http://blogs.msdn.com/csharpfaq/default.aspx

Posted at Monday, July 11, 2005 8:06:13 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

It usually takes ages until I find the page with the format strings on MSDN. So here's a short note, not to forget it.

C or c Currency
D or d Decimal
E or e Scientific (exponential)
F or f Fixed-point
G or g General
N or n Number
P or p Percent
R or r Round-trip
X or x Hexadecimal

[1] msdn.microsoft.com

Posted at Saturday, July 09, 2005 11:25:56 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 
Sequoia View
Posted in Tools

Sequoia View is still a great software to visualize your harddisks usage and find big files or directories with many small files. The usage of Cushion Treemaps makes this special look and feel. At the homepage choose Tips & Trix to find some information how to enable right-clicking folders to start Sequoia View. Since harddisks became larger, the tool needs amlost 10 minutes to check my 60G system disk the first time. I remember the first time I used the tool on a 2G disk, it just needed a few seconds.

[1] http://www.win.tue.nl/sequoiaview/

Posted at Friday, July 08, 2005 2:22:13 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 
Google Earth
Posted in Microsoft | Tools

Google Earth [1], is a nice application, using DirectX and Google Maps [2]. So I was looking for Microsoft Research in Cambridge [3], UK.

You can really waste a lot of time, scrolling around and looking all the nice places. Beside this I found the German headquarter of Microsoft Deutschland GmbH [4], too.

[1] http://earth.google.com/products.html
[2] http://maps.google.com/
[3] http://research.microsoft.com/aboutmsr/labs/cambridge/default.aspx
[4] http://www.microsoft.de/

Posted at Sunday, July 03, 2005 12:05:03 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [1] #      | 
80x15 Buttons
Posted in Tools

I just found the link to this 80x15 button maker [1] on schrankmonster. And I really like its output:

[1] http://www.lucazappa.com/brilliantMaker/buttonImage.php

Posted at Sunday, July 03, 2005 1:47:54 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [1] #      | 
Drinks in AD
Posted in Windows

Today I got the hint to take a deeper look into the AD. Surprisingly I found the following entry in the Active Directory Schema [1]:

Sounds like a joke, doesn't it? If you have a look into RFC 1274 [2] search for section 9.3.5. There you will find

9.3.5.  Favourite Drink

   The Favourite Drink attribute type specifies the favourite drink of
   an object (or person).

     favouriteDrink ATTRIBUTE
         WITH ATTRIBUTE-SYNTAX
             caseIgnoreStringSyntax
             (SIZE (1 .. ub-favourite-drink))
     ::= {pilotAttributeType 5}

Seems like it is no joke at all...

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/a_drink.asp
[2] http://www.ietf.org/rfc/rfc1274.txt?number=1274

Posted at Tuesday, June 14, 2005 10:50:53 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

Because I needed this for a demo CD: just some information how to build autorun.inf files [1].

[1] http://autorun.moonvalley.com/autoruninf.htm

Posted at Wednesday, June 08, 2005 2:11:16 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 
Copyright © 1995-2009 by Andreas Heil. aheil is a registered trademark of Andreas Heil. All rights reserved.
The opinions expressed herein are my own personal opinions and do not represent my employers' views in any way. Content and thoughts expressed on these pages and the weblog are subject to be changed. Out of date posts should not be considererd as my current thoughts and opinions.