May 2003 - Posts

VS.NET and editing Resx files

Am I missing something or is it really true that the built-in resource editor in VS.NET only supports strings? I can't find anyway to put binary files (for example, a bitmap) into a ResX in VS.NET's resource editor. Thankfully, there's Lutz Roeder's Resourcer.

And lucky for me Mr. Roeder makes the source available because it needs a tweak. You can pass a .resources file to Resourcer, but when it starts up it won't open the file -- it's just not programmed to do that. This means you can't set up an association in Windows Explorer and you can't use it from within VS.NET by modifying the "Open With..." for .resources files. Time to edit some C# code!

Change the code in Main() to this:

string initFilename = null;
if( args.Length > 0 )
    initFilename = args[0];
System.Windows.Forms.Application.Run(new MainFrame(initFilename));

Now change the constructor to be two constructors:

public MainFrame() : this(null)
{
}
public MainFrame(string file)

Not really required, but since the original contained a parameterless constructor, I wanted to make sure this one still would. Finally, at the bottom of the constructor, replace the New_Click(this, null) line with the following code:

if( file == null )
    New_Click(this, null);
else
    LoadResourceFile(file);

Compile and enjoy!

Posted by PSteele | 5 comment(s)

Remote Tracing

Simon Mourier has come up with what looks like a very cool library to trace .NET apps over the network:

I have just finished a tool called TraceServer (what a terrific name) that allows you to use distributes all you standard .Net Traces for new or existing applications to any remote machines listening for it. The trace distribution includes code source and stack frame information as well.

You can have multiple servers collecting standard .Net traces for one machine, and multiple clients connected to any number of these servers, receiving their traces.
Posted by PSteele | with no comments

VB.NET: Under The Covers

Being a curious kind of guy, I decided to look into some of the features unique to VB.NET.  A combination of some VB.NET code, ILDASM and Anakrino and my questions were answered!

Ever wonder how VB.NET implements static local variables since the CLR does not support this?  Read and find out!

Posted by PSteele | 2 comment(s)

Catching Windows messages

I needed to capture mouse clicks before my windows app got a hold of them.  Seeing that the Form class has a PreProcessMessage method I thought I was all set.  As the documentation stated:

Preprocesses input messages within the message loop before they are dispatched.

Perfect!  I'll grab my mouse input as needed and then let it pass on to my application for normal processing.

No go.  I overrode the method and was clicking and moving all over the place and never got a single message.  I did a bit of googling and found out that PreProcessMessage is only for keyboard messages.  I don't know about you, but I consider a mouse as an "input" device.  Lesson learned (and I reported the documentation issue to Microsoft).

Solution?  IMessageFilter and Application.AddMessageFilter.  So easy...  :)

Posted by PSteele | with no comments

Is Ingo Rammer going to Microsoft?

First was Don Box.  Then Tim Ewald, Chris Sells and Robert Scoble.  Now Ingo Rammer is posting that his first "assignment" will be in mid-August and he'll be in Redmond the last week of June.  Hmmm....  Could the remoting guru be Microsoft's next big catch?

Posted by PSteele | 3 comment(s)

Beware of the DataSet serialization

From a Visual Studio Magazine HotTip:

...the DataSet is serialized as XML, even when a binary formatter is used. As a result, the DataSet is approximately five times larger than the custom collection over the wire.
Posted by PSteele | 2 comment(s)

Frans says goodbye...

... to Hungarian Notation:

A customer doesn't give a you-know-what about the zillion + 1 reasons you can bring to the table why you had to make the interfaces of the classes inconsistent with the rest of the classes used in the application (f.e. the .NET classes).

I'm not with Frans on this one.  I gladly gave it up.  As IDE's have progressed, the need to identify the type and scope of a variable by using its name has diminished.  I really like the style used in the .NET Framework and we've adopted that style where I work.

Posted by PSteele | with no comments

OPML Swapping

Something I just noticed: If you've got a bunch of subscriptions in RSS Bandit and want to play around with SharpReader, the OPML format exported by RSS Bandit is not immediately usable by SharpReader.  I'm not up on the OPML format so I don't know which program is at fault, but there's a simple fix:

Load up the RSS Bandit OPML file in any text editor and do a global search and replace on "link=" with "xmlUrl=".  SharpReader can now import your subscriptions.

Posted by PSteele | 1 comment(s)

RSS Bandit Comments

Now that's I've dumped Radio, I'm looking for a news aggregator.  I worked a little with RSS Bandit this morning.  A nice little app.  A few things I'd like to see:

  • Automatically get the title of the weblog from the RSS feed.  Why do I need to type this in?
  • Drag/Drop URL's to add a new feed.
  • Support for CTRL-F4 to close a newsfeed tab.

I'm also going to look into SharpReader and Syndirella, but I've seen a few blogs indicate that development on SharpReader may have "stalled" a bit.

Posted by PSteele | 4 comment(s)
Filed under:
More Posts Next page »