The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,308 other followers

Archive for the ‘.NET’ Category

.NET/C#: Interesting DocX library to create OOXML documents for Word

Posted by Jeroen Pluimers on 2014/07/10

In case I need to export DocX in .NET again: DocX – Home.

(I did it both with Word Automation and OOXML, they were a pain).

–jeroen

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Office, Office 2007, Office 2010, Office 2013, Office PIA, Software Development | Leave a Comment »

VB.NET: If you want to cast use DirectCast or TryCast; if you want to convert, use CType

Posted by Jeroen Pluimers on 2014/07/03

I’ve done quite a bit of VB.NET maintenance lately.

Most of that code was riddled with CType, both for conversions and casts. Quite a bit code had Option Explicit and Option Strict Off. A lot of those CType constructions had empty Try / Catch / End Try blocks around them.

Those empty catch blocks are a code smell. They pretend to be able to survive any exceptional disaster, but in practice you can’t. You have to indicate what kinds of disasters you can handle, for instance if a meteorite hits your data center (thanks George Stocker).

Turning off Option Strict can be OK under many circumstances (the default is off), but having Option Explicit off is usually a code smell as well, just like On Error Resume Next (which was also in plenty of the source code).

I do understand a lot of VB.NET source comes from people having programmed in VB 6, VBScript or VBA for a long time where those constructs were more common. But writing code in the 21st century is much more about writing code that you can prove to be right. Having proper error handling and compiler type checking is a big part of that.

It pays to go with the idiom, for example read the good and bad ways of vb.net – Safest way to check for integer.

Back to CType: basically you have do distinguish between conversions and casts. The reason is that when you know it will be a form of cast, CType is way to expensive. And if you know you will be doing conversions, than casting is not what you want.

Casting Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »

Some notes/links on Windows Debugging CLR applications

Posted by Jeroen Pluimers on 2014/07/02

I only need it every once in a while, so finding the right links and tips to help me usually takes too much time.

So here is a small list to get started:

Keywords: CLR, SOS.DLL, WinDbg, mscordacwks.dll, PSSCOR4

Some tips: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Debugging, Development, Software Development | Leave a Comment »

.NET/C#: open source Nikon SDK C# Wrapper project at SourceForge.net

Posted by Jeroen Pluimers on 2014/06/26

Interesting: about a year and a half ago, the Nikon SDK C# wrapper project started ad sourceforge.

Basically, it allows you to integrate the operation of your Nikon DSLR into your .NET projects.

It has some very interesting features:

  • Control your Nikon DSLR via USB
  • Capture Jpeg and Raw images directly to system memory
  • Receive ‘Live View’ images
  • Record Video
  • Query and change camera settings (Exposure, Aperture, ISO, etc.)
  • And much more…

Downloads: Nikon SDK C# Wrapper – Browse Files at SourceForge.net.

–jeroen

via: Nikon SDK C# Wrapper | Free Security & Utilities software downloads at SourceForge.net.

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

StudioShell: integrating Visual Studio in PowerShell

Posted by Jeroen Pluimers on 2014/06/10

Wow, it seems I’ve been living under a stond since early 2011: the first StudioShell checkin.

StudioShell opens marvellous possibilities in Visual Studio 2010, 2012 and up.

Just look at the feature list: Read the rest of this entry »

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 1,308 other followers

%d bloggers like this: