Archive for April, 2010
The Visual Studio Documentary
Apr 13th
Two part excellent history of Microsoft languages and developer tools video at channel9.
Lets look at the timeline.
Products and Milestones
1975 – Bill Gates and Paul Allen write a version of Basic for Altair 8080
1982 – IBM releases BASCOM 1.0 (developed by Microsoft)
1983 – Microsoft Basic Compiler System v5.35 for MS-DOS release
1984 – Microsoft Basic Compiler System v5.36 release
1985 – Microsoft QuickBASIC 1.0
1986 – Microsoft QuickBASIC 1.01, 1.02, 2.00
1987 – Microsoft QuickBASIC 2.01, 3.00, 4.00
1987 – Microsoft BASIC 6.0
1988 – Microsoft QuickBASIC 4.00, 4.00b, 4.50
1989 – Microsoft BASIC Professional Development System 7.0
1990 – Microsoft BASIC Professional Development System 7.1
1991 – Microsoft Visual Basic released May 20-Windows World Convention –Atlanta
1992 – Microsoft Visual Basic 2.0
1993 – Microsoft Visual Basic 3.0 in Standard and Professional versions
1995 – Microsoft Visual Basic 4.0 released, supported the new Windows 95
1997 – Microsoft Visual Basic 5.0 – introduction of IntelliSense
1998 – Microsoft Visual Studio 6.0 that included Visual Basic 6.0 released (first VS)
2002 – Microsoft Visual Basic .NET 7.0
2002 – Visual Studio .NET
2003 – Microsoft Visual Basic .NET 7.1
2003 – Microsoft Visual Studio w/Intellisense
2003 – Visual Studio .NET
2004 – Announce Visual Studios 2005 – Code name Whidbey
2005 – Visual Studio 2005 release w/Extensibility
2005 – Visual Studio Express released
2006 – Expression Tool Set released – devs and designers work together
2006 – Visual Studio Team release – November 30th
2007 – Visual Studio 2008 (code name Orcas) ships November = Video Studio Shell
2010 – Visual Studios (code name Rosario)
Visual Studio 2010 Featured Content
Apr 12th
Very important MSDN web page. Check out Visual Studio 2010 Featured Content.
Take advantage of all the new features in Visual Studio 2010! On this page, we’ve compiled some of the best content available for developers to help you get up-to-speed on what you can do with Visual Studio 2010, as well as what we’ve done to help you be much more productive and have a lot more fun writing code. From multi-monitor support, .NET Framework 4 integration, the debut of F#, full integration with Silverlight 4, and much more – we’re sure you’ll love Visual Studio 2010 as much as we do.
Prevent Standby
Apr 8th
One of my colleague ask me about how to “prevent standby” from csharp code.
It obviously has nothing to do with csharp or any kind of .net languages.
The real solution rely on Kernel32.dll SetThreadExecutionState API.
Lets check out the msdn and write the code with Csharp.
Msdn says for SetThreadExecutionState:
Enables an application to inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running.
Return Value
If the function succeeds, the return value is the previous thread execution state.
If the function fails, the return value is NULL.
Cool. Ok lets see what pinvoke.net says about this.
SetThreadExecutionState is used to stop the machine timing out and entering standby/switching the display device off.
Ok. Thats exactly what we want!
Prepare the enum, then [DllImport] attribute and then Prevent and Allow Methods.
public static class NativeCalls
{
[FlagsAttribute]
public enum EXECUTION_STATE : uint
{
ES_SYSTEM_REQUIRED = 0x00000001,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_CONTINUOUS = 0x80000000,
}
//Do not forget to add the System.Runtime.InteropServices using directive
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
public static void PreventMonitorPowerdown()
{
SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED |
EXECUTION_STATE.ES_CONTINUOUS);
}
public static void AllowMonitorPowerdown()
{
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
}
}
And read carefully the pinvoke’s note:
There is no need to store the state you set, Windows remembers it for you. Just set it back to ES_CONTINUOUS when you don’t want it anymore. Also note that this setting is per thread/application not global, so if you go to ES_CONTINUOUS and another app/thread is still setting ES_DISPLAY the display will be kept on. Note that the return value is the EXECUTION_STATE that ”was” set.
After all don’t forget the compile with -unsafe option.
Ef 4.0 on dnrTV
Apr 3rd
Julie Lerman on the Entity Framework version 4.0
Julie Lerman takes you through using the Entity Framework 4.0 including creating models, reverse engineering, mapping, customizing and applying to a real application.
Watch or download this show here.
Also don’t miss out the previous shows. dnrTV rocks!