dotNoted

Icon

Observations of .Net development in the wild

Live search finally gives me better results than Google – for once.

I’m trying to display a lot of text on a control in a Windows Installer UI (the IT wonks like to see the SQL before I brazenly connect to the database and run amok – talk about paranoia!) and am not having much luck with it. The Windows Installer UI is one of the very worst things I have had to program against, for sure. Not only is it exceedingly limiting (can’t do much in terms of dynamic display), but it often doesn’t work in the way that a Windows dev would expect. Principle of least surprise was apparently not requiste reading for the UI team here. But I cut some slack, since it’s a throwback to the relatively bad old days of 2000 – before .Net. The real shocker is that Windows Installer 4 doesn’t have a reworked UI – I mean, come on: .Net 3 is baked into the platform – of course it can be a dependency and you can base an installer UI on it! You do it with user32.dll and advapi32.dll – now mscorlib.dll and friends are just as much part of the Windows (Vista) system! These folks are apparently not sold on the idea, and perhaps really detest installer dependencies (as this fellow does). I think the argument is logically fallacious, though, in the case of Vista. If MSI 4 requires Vista (true) and Vista contains a resource (.Net, for instance, or advapi32.dll) as part of the OS (true) then the installer can depend on it (by modus ponens).
 
But this post is about another MS tentacle^H^H^H^H^H^H^H^H^H department. Live search is quietly getting better. I looked for "windows installer license text property" to see about using a property as a source for the ScrollableText control, and Live’s first 25 results are more relevant. Good show. First time this has happened for me.
 
That actually says a lot about how good Google is, and how much longer Live’s team will have to work hard. I feel sorry for the engineers’ families.

Filed under: Tools

C++/CLI string interop helper macros

Macros sure are useful in C++ (wish C# had something like them)…
 
Of course, they can and do get abused (although to sometimes marvelous effect). But keeping things simple and straightforward they prove their worth.
 
I find myself converting from managed to unmanaged strings fairly often. These macros help:
 
#define managed_str(native_string) System::Runtime::InteropServices::Marshal::PtrToStringAuto(IntPtr::IntPtr((void*)native_string))
#define native_str(managed_string) (LPCTSTR)System::Runtime::InteropServices::Marshal::StringToHGlobalAuto(managed_string).ToPointer()
 
Then you can just convert like this:
String^ managedString = managed_str(TEXT("This was a native string"))
LPCTSTR nativeString = native_str(L"This was a manged string")

Filed under: C++ / CLI

Aaron Marten’s WebLog : Open the Floodgates!

My, how times change….

On the licensing side, we’re also making a change that should have a huge impact on the developer tools community. We have removed the licensing restriction that requires you to target a Microsoft platform. Yes, you read that correctly. Feel free to re-read it again if the shock hasn’t set in yet. You can now legally create a Visual Studio package for tools to target the JRE, Linux, Apache, or whatever your platform of choice may be!

Aaron Marten’s WebLog : Open the Floodgates!

Filed under: Uncategorized

SharpMap

I’ve been contributing to the SharpMap project lately (as codekaizen). This contribution unites my interest in .Net and DirectX graphics, GIS, Linear Algebra and Software Engineering.
 
It’s also important for a project at my day job. We’ll have the best mapping component money doesn’t have to buy. Way better than some other libraries, which don’t even offer updatability to their native format. How lame is that? That has always bothered me, especially given the price tag on those components.
 
Check it out, it is a great library, and many people are using it.

Filed under: .Net Graphics