Tuesday, April 24, 2007

Adobe Reader on Vista Ultimate x64

After a lot of work and googling I finally managed to get Adobe Reader to install. The funny thing is that Adobe says that version 8 is Vista compatible. I'd like to question that, at least regarding the installer..

Downloaded

Adobe Reader 8 for Windows Vista

Started the installer, got the downloaded file warning but not the UAC dialog, then... absolutely nothing happened.

Then I tried "Run as administrator", still the same... absolutely nothing happened.

Googled around and found indication that running in XP SP2 compatibility mode might help. It did..

But come on Adobe, get your act together and produce an installer that Joe Average can use without extra fuzzing about!

Tuesday, April 03, 2007

Somasegar's WebLog : Listening to your feedback - Expression and MSDN

It seems a miracle has happened. Microsoft revaluated their decision about not including Expression Blend in MSDN subscription. Now it seems both Web and Blend (after its release) are included. Whoohoo! 

Link to Somasegar's WebLog : Listening to your feedback - Expression and MSDN

Simple properties

What do you prefer?

1)

private int m_foo;
public int Foo
{
get { return m_foo; }
set { m_foo = value; }
}

2)
public int Foo { get; set; }

3)
public:
property
int Foo;


The first is C#, the second C# 3.0 and the third one is C++/CLI

Monday, April 02, 2007

Nullable in C++/CLI

I was recently working on a C++/CLI project (which I only rarely do, as you'll soon find out)where there was a need to have a method returning a nullable DateTime.

I look up Nullable in the help, I see "ref class Nullable", think that the following will do it.

Nullable<DateTime>^ GetStuff();

I implement the thing and am a happy camper until I try to use it from a C# project. The intellisense says ValueType GetStuff(), WTF !?!

I take a look once again and find out that Nullable<T> is "public value class", so the correct incantation should have been:

Nullable<DateTime> GetStuff();

oh, and to return a null value you just do:

return Nullable<DateTime>();

(Anyone else finds the C# ? syntax for nullable types more easily digested?)

Monday, March 26, 2007

Dependency Visualizer 1.2.0

Just released at http://koti.mbnet.fi/tunedude

Whats new:

  • Optionally hide .NET 2.0 references
  • Optionally hide .NET 3.0 references
  • Generate svg and/or png
  • Configurable (the above mentioned items)
  • Support for vcproj:s

Thursday, March 22, 2007

utmanad..

Jag har tydligen också lyckats bli utmanad (av trion)

Här är några lagom intressanta påståenden i ingen speciell ordningsföljd:

1. Jag hatar allt som liknar kedjebrev (därmed tänker jag inte heller utmana någon fler..)

2. Har nästan lyckats kapa benet av mej medelst motorsåg..

3. Har deltagit i skönhetstävling.

4. Har blivit halvt korsfäst (ja eller i alla fall blivit spikad i ena handen...)

5. Har diplom i komjölkning

6. Kanin är gott...

Tuesday, February 20, 2007

const (in C++/CLI) considered harmful

Today I found the following "gotcha" in combining C++/CLI and C#.
Create a C++/CLI dll containing something along the lines of:

public ref class Foo
{
public:
static const int BAR = 42;
};
Use that from C#, maybe like so:
int temp = Foo.BAR;
Foo.BAR
= -1;
MessageBox.Show(
string.Format("The answer is: {0} ...or {1}",
temp, Foo.BAR),
"WTF!?!");
Wait, that should not be possible! We just said that BAR was const in the C++/CLI code didn't we?

The problem is that it is possible (and gives the following screenshot):

Digging deeper reveals that C++/CLI const turns into an ordinary field with an optional modifier IsConst that languages are free to ignore, (which e.g. C# does).

If you in fact want a "constant" constant (which is probably why you wrote const in the first place?), then you will need to use literal in C++/CLI to get the same result as a C# const.