The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,862 other subscribers

Archive for March, 2012

.NET/C#: Resolved errors “The type ‘NameSpace.TypeNameClass’ has no constructors defined” and “Interop type ‘NameSpace.TypeNameClass’ cannot be embedded. Use the applicable interface instead.” (via Stack Overflow: Interop type cannot be embedded)

Posted by jpluimers on 2012/03/20

When moving the Microsoft Scripting Runtime interop code from .NET 1.x to 4.x, I got these errors:

Error1: The type 'Scripting.FileSystemObjectClass' has no constructors defined
Error21: Interop type 'Scripting.FileSystemObjectClass' cannot be embedded. Use the applicable interface instead.

Though the first answers on the question seem to adequately resolve the problem, they merely cure the symptom: turning off the embedding of the PIA (Primary Interop Assembly).

The below answer by Michael Gustus (which only has a few votes, so please vote it up) actually explains what is going on, and solves the cause:

In most cases this error is the result of code which tries to instantiate a COM object e.g. here piece of code starting up Excel:

Excel.ApplicationClass xlapp = new Excel.ApplicationClass();

Typically, in .Net 4 you just need to remove the ‘Class’ suffix and compile the code:

Excel.Application xlapp = new Excel.Application();

MSDN explanation here.

Hence I like the comment by Tyrsius on this answer as well:

This was more useful than the marked answer, as I needed the functionality of the embedded Interop. This solved both problems, thank you!

The above answer tells you to not use the class type, but the interface type, just like the error states. And the answer implicitly tells you the class type is ApplicatoinClass, and the interface is Application.

These are the declarations for the PIA interface: Read the rest of this entry »

Posted in .NET, C#, C# 4.0, Development, Software Development | Leave a Comment »

30 HomePlug power line adapters compared (Dutch: vergelijkingstest | Hardware.Info Nederland)

Posted by jpluimers on 2012/03/19

Since WiFi reception on the 2nd floor is bad (max about 20 Mbit/s, but often lower because of interference), as there are reinforced concrete floors in between it and the highest floor I can get cable through for a WiFi access point.

So adapters based on the IEEE 1901 ethernet over power line standard might be an option. HomePlug compatible power line adapters seem to conform to this standard.

Any power line based communication is supposed to be sensitive in having path between the adapters that is as straight as possible (same power phase, no extension cables or converter plugs) so it a comparison with products having plugs being compatible either with they European CEE 7/7 plug (upper picture on the right), or the CEE 7/16 Europlug (lower picture on the right).

The Dutch Hardware.Info site did a comparison of 30 powerline adapters at 25 meter distance which looks promising. The review also explains a bit more on the HomePlug standard, comparison at 50 meter distance, and a separate measurement of a Devolo 500 Mbit/s powerline adapter (which is slower than the NetGear adapters).

Note that the  fastest owerline adapters use about 5 watt each, even when idle. so convenience comes at a price.

The Netgear XAVB5004 is their product of choice, as only Netgear provided 500 Mbit/s equipment. So I went looking for other reviews.

SmallnetBuilder has published their test plan, some hints of avoiding noise, and published a roundup of HomePlug AV 500 compatible adapters and explains how the 500 Mbit/s powerline technology works. Their tests use USA models, and favour Belkin, D-Link, Zyxel and Trendnet over the Netgear products.

–jeroen

via: 30 powerline adapters vergelijkingstest | Hardware.Info Nederland.>

Posted in LifeHacker, Power User | Leave a Comment »

Finaly, Audacity 2.0.0 is there (via: Release Notes 2.0.0 – Audacity Wiki)

Posted by jpluimers on 2012/03/16

Finally, Audacity made it to version 2.0.0.

From their release notes:

Read the rest of this entry »

Posted in Audacity, Audio, ffmpeg, Media, Power User | Leave a Comment »

Start a New Line Inside a Spreadsheet Cell in Excel | Excel Semi-Pro

Posted by jpluimers on 2012/03/16

Unlike most tools where you use Shift-Enter to add a line break character (ASCII 10: line feed), Excel is different:

Sometimes it’s necessary to have more than one line inside a worksheet cell, which is easily done with a line break.

Add a new line by holding down the Alt key while you press enter. It’s the keyboard shortcut Alt+Enter. In Excel 2008 and 2011 for Mac use Cmd+Option+Enter.

–jeroen

via: Start a New Line Inside a Spreadsheet Cell in Excel | Excel Semi-Pro.

Posted in Excel, Keyboards and Keyboard Shortcuts, Office, Office 2000, Office 2003, Office 2007, Office 2010, Office 2013, Office 2016, Power User | Leave a Comment »

Patch time: RDP vulnerability in all Windows versions; CVE-2012-0002: A closer look at MS12-020’s critical issue – Security Research & Defense – Site Home – TechNet Blogs

Posted by jpluimers on 2012/03/15

If you have RDP open on one or more of your computers, you should have patched your machines by now:

vulnerabilities in Microsoft’s implementation of the Remote Desktop Protocol (RDP) […] a Critical, remote code execution vulnerability affecting all versions of Windows. This blog post shares additional information with the following goals:

  • To strongly encourage you to make a special priority of applying this particular update;
  • To give you an option to harden your environment until the update can be applied.

–jeroen

via: CVE-2012-0002: A closer look at MS12-020’s critical issue – Security Research & Defense – Site Home – TechNet Blogs.

Posted in Power User, Windows, Windows 7, Windows Server 2003, Windows Server 2008, Windows Vista, Windows XP | Leave a Comment »

A few reminders to self for AMP in VS11: debugging, writing, etc

Posted by jpluimers on 2012/03/15

Reminders to self:

–jeroen

via: The Moth – GPU Debugging with VS 11.

Posted in .NET, C#, Development, Software Development, Visual Studio 11, Visual Studio and tools | Leave a Comment »

WTF C# code of the month

Posted by jpluimers on 2012/03/14

When I come across code like this, I’m always astonished:

			catch(Exception ex)
			{
				string strMess = ex.Message;
			}

What was the person thinking when he wrote this? Did he get distracted and nobody else notice this before checking it into their version control system?

In the same module:

		private string ToString(object myVal)
		{
			try
			{
				if (myVal != System.DBNull.Value)
					return myVal.ToString().Trim();
			}
			catch{}

			return "";
		}

–jeroen

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

Solution for TFS2005/2010 and VS2005/2010: Add/New Work Item menu still loading (try again in a moment)…

Posted by jpluimers on 2012/03/13

Sometimes when creating new Team work items in Visual Studio 2010 connected to Team Foundation System 2010, you get a sub menu like this:

New Work Item menu still loading... (try again in a moment)

“New Work Item menu still loading… (try again in a moment)”

There are not many results in the new work item menu still loading “try again in a moment” site:microsoft.com query, but luckily the first one shows a similar issue in Visual Studio 2005 with Team Foundation System 2005: the “Add Work Item menu still loading… (try again in a moment)”.

The solution is also very simple:

  1. Quit Visual Studio 2010
  2. Delete this registry key
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\WorkItemTracking\TeamMenu\AddWorkItemMru
  3. Start Visual Studio 2010
  4. Retry (can take more than a minute, but it usually works)
The only difference between the Visual Studio 2010 (version 10.0) and Visual Studio 2005 (version 8.0) is the version number:
  • HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\WorkItemTracking\TeamMenu\AddWorkItemMru

Not sure if this can fail in Visual Studio 2008 too, but if it does, just apply this fix with version number to 9.0, and if it happens with the Visual Studio 11 developer preview, change the version number to 11.0.

–jeroen

via: Add Work Item menu still loading….

Posted in .NET, Development, Software Development, Visual Studio 2005, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

How to install Windows 7 on a virtual hard disk (VHD) in 10 steps (via: Guides & Tutorials)

Posted by jpluimers on 2012/03/12

Handy when working with Microsoft Surface: install your development environment on a separate VHD that you can boot as your physical machine (Microsoft Surface SDK does not like being run in a Virtual Machine):

If you accept the constraints described above, I propose the following procedure, which I think is the easiest way to install Windows 7 on a virtual disk in multi-boot

Note: Within the VHD you can still access all the files on your physical HD.

–jeroen

via: How to install Windows 7 on a virtual hard disk (VHD) in 10 steps – Guides & Tutorials.

Posted in .NET, C#, Development, Microsoft Surface, Microsoft Surface on Windows 7, Power User, Software Development, Windows, Windows 7, WPF, XNA | 1 Comment »

When are the 12.5mm 1.5 TB and 14.8mm 2 TB notebook drives coming? (via: Marvell 4Q 2012 – Hard Drives Coming Back, SSD Controller Sales Double – Storage Forums)

Posted by jpluimers on 2012/03/09

Since about 9 months, 2.5 inch notebook drives ship that have 500 gigabyte platters.

With that technology, these drives ship:

they easily could manufacture these configurations:

Read the rest of this entry »

Posted in Hardware, Power User, SSD, ThinkPad, W701 | 2 Comments »