Outside The Box

Random thoughts about AutoCAD, ObjectARX, and the meaning of life.
All Original Content Copyright 2006 - 2008 Owen Wengerd, All Rights Reserved

The new Visual Studio 2008 has been released, and to celebrate, I've updated VC Build Hook. The updated utility allows you to use the new IDE while still building with older versions of the build tools.

Why is this necessary? If you build your AutoCAD 2007/2008 ObjectARX application with the Visual C/C++ 9.0 tools, AutoCAD will display a warning message about an incompatible module when you try to load it. You can use VC Build Hook to target all previous AutoCAD versions from a single Visual Studio 2008 solution (if you have the correct version of Visual C/C++ installed alongside Visual Studio 2008).

In my testing so far, existing Visual Studio 2005 projects build without problems in Visual Studio 2008 when VC Build Hook is installed and the new 'BuildToolVersion' property is set to the correct version.

Labels: , , ,

No, Microsoft didn't really try to patent photons, but check out the the ironic twists described in this account of a recent US Supreme Court hearing. Here's a summary (exaggerated a bit for effect):
1. Microsoft argues that software is not patentable, therefore it is not guilty of patent infringement.
2. The US Government argues on Microsoft's behalf that software is patentable, but photons are not.

Labels: ,

I pointed out in a previous post that while the press release headlines pronounced that Vista will support DWF natively, the fine print says otherwise. What Vista does support natively is Microsoft's new XPS (XML Paper Specification) format. Autodesk has since clarified that they are working on a new DWF format called DWFx that is, essentially, a DWF in XPS format.

A quick test verified my suspicions that XPS files produced by the Microsoft XPS Document Writer are much larger than comparable DWF files. The jury is still out on DWFx file sizes, but a recent post on Scott Sheppard's blog (http://dwf.blogs.com:80/beyond_the_paper/2007/02/autocad_2008_dw.html) has buried within it a telling comparison point between DWF and DWFx.

The chart uses a neat gambit by comparing both DWF and DWFx file sizes to the completely different DWG format, but the math cognoscenti among you will notice that "typically 1/20 the size of the DWG" for DWF and "typically 1/10 the size of the DWG" for DWFx translates into "DWFx files are twice as large as DWF". There is no information on file generation times, another metric worth monitoring.

Autodesk has been pretty generous lately, first giving away Design Review, now perhaps gearing up for an exclusive two-for-the-price-of-one deal on DWFx. I haven't heard too many customers requesting larger file sizes, though.

Labels: , , ,

With the advent of Visual Studio 2005 and automatically generated manifest files, the topic of when and how to use manifest files comes up occasionally. Since a default ObjectARX wizard generated project in Visual Studio 2005 generates an embedded manifest by default, most people don't even think about it. Of course that was the whole idea -- the manifest would ensure that the correct dependent DLLs get loaded, and voila, no *need* to think about it. One of my programming axioms applies in this case: TANSTAAFL.

The problem is that ObjectARX applications are not in charge. AutoCAD is in charge, and it will decide which VC runtime and MFC runtime DLLs to load. If your ObjectARX application loads a different VC or MFC runtime than the ones AutoCAD is using, you'll encounter big problems. I've always advised disabling the manifest completely (see my ObjectARX Tips page) to avoid such a possibility. Unfortunately, there's a catch.

The problem is that linking to the ATL80.DLL file isn't possible by just disabling the manifest and doing nothing more. ATL is now a side-by-side (SxS) assembly, and it no longer lives on the Windows support path, so a standard un-manifested DLL won't be able to find it. The preferred solution is to link statically to ATL (see Configuration -> General -> 'Use of ATL' in VS 2005 project properties) and avoid the problem altogether. If you only have one module that uses ATL, this is always the best solution.

The less desirable solution is to add a *manually-created* manifest that specifies the desired ATL SxS assembly, but ignores the VC and MFC runtime DLLs. You'll still need to decide whether to make ATL shared or private, and in either case you *must* distribute ATL with your application to ensure that it is available when your application is deployed. You can cheat, and let VS generate your manifest file (instruct it to *not* embed the file), then just edit the resulting .manifest file to remove references to the VC and MFC assemblies. For example, here's one that I generated (you'll need to generate your own to ensure that the manifest matches the version you are redistributing):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<dependency>
<dependentassembly>
<assemblyidentity type="win32" name="Microsoft.VC80.ATL" version="8.0.50727.762" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b">
</assemblyidentity>
</dependentassembly>
</dependency>
</assembly>

In my work, I've had very little need for manifests. The VC optimizer is able to strip the unused portions of statically linked ATL out of your code, leaving a much smaller footprint than the entire assembly would require. This eliminates the need to redistribute ATL with your application, thus reducing the overall potential for deployment issues. Nevertheless, there are exceptions to every rule, and your mileage may vary.

Labels: , , , , ,

I've installed Visual Studio 2005 SP1 and have been busy testing all my projects to make sure they didn't break. Microsoft did fix at least one of the bugs I reported (the resource editor choked on resource strings that contained an embedded NULL character), but the IDE still crashes fairly consistently if I initiate a large solution build while the Intellisense database is being rebuilt. SP1 also managed to break my VCBuildHook utility, so I've uploaded an updated version (2.0.3.0) for use with SP1.

Labels: , , ,

Finally, the long awaited service pack 1 for Visual Studio 2005 is released! The service pack has been in the pipeline since soon after Visual Studio 2005 shipped last November, with release dates slipping month after month. The latest official release date was announced as "early 2007". Perhaps this was an intentional attempt to alleviate some of the waiting pains with a suprise release (or maybe just the Microsoft rumor mill on autopilot).

Be prepared for a long install. The download page warns that it could take an hour or more to verify digital signatures before the service pack installation even begins.

Labels: , , ,

Not according to the press release. Vista (and .NET 3.0) includes a built-in XPS Viewer (also available for Windows XP SP2 and Windows Server 2003), which will view any XPS format file. Apparently Autodesk plans to add support for output to XPS format in the future, and this output will be called DWFx -- a new file format. It's not clear what the difference will be between DWFx and the output produced using the Microsoft XPS Document Writer that is already available.

I installed the Microsoft XPS Document Writer and XPS Viewer on my Windows XP SP2 machine. Next, I started AutoCAD 2007 and opened "3D House.dwg" from the Sample folder. I then plotted this file to DWF, PDF, and XPS, with the following results:


PlotterPlot TimeFile Size
DWF6 ePlot.pc37 seconds139 kb
DWG To PDF.pc35 seconds165 kb
Microsoft XPS Document Writer34 seconds829 kb

I'm not suggesting that these files all contain the same content, I'm merely suggesting that DWFx/XPS may have some undesirable tradeoffs in practice.

This whole issue about "native Vista support for DWF" may be nothing but smoke and mirrors. There is no guarantee that publishing CAD data in the XPS format will be efficient. So what will happen if users can choose between a compact DWF, a slightly less compact but ubiquitous PDF, or a very space-hungry DWFx? Time will tell, but I think this issue of DWF in Vista is getting way to much spin and not enough critical analysis.

Labels: , , , ,