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 4,262 other subscribers

Archive for February, 2012

Solution for Visual Studio 2010 VB.NET errors “Type ‘MyProject.My.MySettings’ is not defined.” and “MyProject’ is not a member of [Defalut]” #VS2010

Posted by jpluimers on 2012/02/29

(Note the WordPress bug: you cannot have <Default> in a topic title, but having it in the text is fine, hence the [Default] in the title).

When porting some projects from .NET 1.x to .NET 4.x, I got these two errors:

Error 17 Type 'MyProject.My.MySettings' is not defined.
Error 18 'MyProject' is not a member of '<Default>'.

Both errors in the file ...\My Project\Settings.Designer.vb relative to the MyProject.vbproj file.

This was not the result of something like this Visual Studio 2005 bug, but of how the designer generated files are not being regenerated when you change the root namespace only in the MyProject.vbproj file, not through the IDE.

Steps to reproduce:

  1. Create a MyProject class library in VB.NET
  2. In the MyProject.vbproj, change the RootNameSpace into MyNameSpace.MyProject.vbproj
  3. Build

Lesson learned: when using text compare tools, some .vbproj changes should be propagated through the IDE, not through your favourite text compare tool.

When you change it in the IDE, it regenerates the *.Designer.vb files to reflect the changed namespace.

The solution is simple, in the IDE follow these steps:

  1. In the Project Options change the RootNameSpace to a dummy
  2. Build your project
  3. Chante the RootNameSpace to what you want
  4. Build your project

–jeroen

via: type “my.mysettings” “is not defined.” – Google Search.

Posted in .NET, Development, Software Development, VB.NET | Leave a Comment »

P/Invoke: usually you need CharSet.Auto (via: .NET Column: Calling Win32 DLLs in C# with P/Invoke)

Posted by jpluimers on 2012/02/28

I don’t do P/Invoke often, and somehow I have trouble remembering the value of CharSet to pass with DllImport.

In short, pass CharSet.Auto unless you P/Invoke a function that is specific to CharSet.Ansi or CharSet.Unicode. The default is CharSet.Ansi, which you usually don’t want:

when Char or String data is part of the equation, set the CharSet property to CharSet.Auto. This causes the CLR to use the appropriate character set based on the host OS. If you don’t explicitly set the CharSet property, then its default is CharSet.Ansi. This default is unfortunate because it negatively affects the performance of text parameter marshaling for interop calls made on Windows 2000, Windows XP, and Windows NT®.

The only time you should explicitly select a CharSet value of CharSet.Ansi or CharSet.Unicode, rather than going with CharSet.Auto, is when you are explicitly naming an exported function that is specific to one or the other of the two flavors of Win32 OS. An example of this is the ReadDirectoryChangesW API function, which exists only in Windows NT-based operating systems and supports Unicode only; in this case you should use CharSet.Unicode explicitly.

–jeroen

via: .NET Column: Calling Win32 DLLs in C# with P/Invoke.

Posted in .NET, Ansi, C#, Delphi, Development, Encoding, Prism, Software Development, Unicode | 3 Comments »

won’t work on a ThinkPad W701: DisplayPort Adapter Cables 45J7915, 57Y4393 Compatibility – ThinkPad W700/W701

Posted by jpluimers on 2012/02/27

Dang this won’t work:

The ThinkPad W700/W701 DisplayPort is a DisplayPort-only source, not a Dual-Mode source, and thus cannot support the DisplayPort adapter cables.

See also this PDF:

ThinkPad W701, W701ds Multiple Monitor Configurations
Boost productivity, view more data
** DisplayPort to Single-Link DVI (45J7915) or VGA (57Y4393) monitor cables are not supported on the W701 DisplayPort

–jeroen

via: DisplayPort Adapter Cables 45J7915, 57Y4393 Compatibility – ThinkPad W700/W701.

Posted in Power User, ThinkPad, W701 | Leave a Comment »

ThinkPad W701 with 32GB of memory via: forum.thinkpads.com • Newer 8G memory sticks in a W700, W701, W500, W510 ?

Posted by jpluimers on 2012/02/27

Just as a mental note: it is possible to put 32GB of memory in a ThinkPad W701:

for a while now, 32GB on 2x W701

–jeroen

via: forum.thinkpads.com • Newer 8G memory sticks in a W700, W701, W500, W510 ?.

Posted in Power User, ThinkPad, W701 | Leave a Comment »

Scott Adams uses a Wacom Cintiq 24HDI for his drawing.

Posted by jpluimers on 2012/02/24

Recently, I noticed that Scott Adams uses a Wacom Cintiq 24HD to do his art work:

I do all of my drawing directly to the computer screen of my Wacom Cintiq 24HD. I literally feel sympathy for any artist who still works with pen and paper. The system cuts my production time in half and allows me to do better work too. If youre an artist, and youre still drawing on paper, youre like the seventy-year old author who swears by his manual typewriter.

Great gadget that has it price, but loved by artists.

–jeroen

via: Scott Adams Blog: Today I Review Everything 02/10/2012.

Posted in LifeHacker, Opinions, Power User | Leave a Comment »