Friday, July 4, 2008
The correct and best way today to develop 3D applications for business and scientific domains on Windows is to use WPF (Windows Presentation Foundation), which is part of .NET 3.x. WPF exploits 3D acceleration hardware like DirectX and is fully accessible to C# desktop applications. And it's compatible with Visual Studio 2008 -- in fact WPF seems to be the primary reason Visual Studio 2008 was even built.
That's a screenshot of a WPF application I'm working on. The cylinder and metal cans were mathematically computed on the fly in C#, because they're such simple shapes. The hammer and chisel were designed in Blender 3D and exported to XAML. Using standard Windows mouse interaction code, the cylinder, cans, and hammer can be dragged around.
Thursday, May 29, 2008
It is possible to disable XP's check for signed drivers with the code
Of course, it's also possible to disable it manually via Start->Control Panel->System->Hardware->Driver Signing. But the C code from the link above allows an installer to disable it automatically. For the vertical application I maintain, I bundle every possible A/D board driver into an all-in-one InstallShield installation, and I have to use a variety of tricks to make them all install silently. This is the latest such trick.
I ran into this while trying to use some ActiveX controls out of National Instruments' Measurement Studio. Measurement Studio needed the RTM version of MFC, but my Visual Studio 2005 SP1 would only create applications with the SP1 version of MFC. And they conflicted, generating "activation context" errors.
To handle SxS, Visual Studio 2005 introduced the concept of manifest files, which specify precisely which version(s) of which DLL(s) are required. There is even a mechanism to automatically promote to using later versions of required DLLs. No matter the combination, I couldn't get my MFC application to work with Measurement Studio, because I of course did not have the source code to Measurement Studio to recompile it against the SP1 version of MFC. As one blog author put it, in the course of trying to solve DLL Hell (for the user), Microsoft ended up creating Manifest Hell (for the developer).
So my solution was to use ATL instead, and let Measurement Studio use the RTM version of MFC.
I discovered this when I couldn't find ShFolder.h in my Visual Studio2008 directory. Thankfully, I still have Visual Studio 2005 installedas well.
To achieve the same effect as deleting the component, I just deleted all the files within that component instead, and that worked fine.