Visual Studio .NET 2005’s Command Line Tool.

December 28th, 2007 § 0 comments § permalink

What I’m trying to do: call the link.exe to make a SampleFile.res into a SampleFile.dll.

Approach 1: Manual call from the Command Line Tool (CLT).
I don’t like this idea because I’d have to open the CLT every time I want to recompile the *.res into a *.dll.
[Call 1] C:\Program Files\Microsoft Visual Studio 8\VC\bin> C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res

[Call 2] C:\Program Files\Microsoft Visual Studio 8\VC\bin> link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res

***I showed two calls for a reason. They do the same exact thing and both work successfully on the CLT.

Approach 2: Automate call from the Pre-Build event in the project.
I like this approach because it allows me to edit the file whenever I want and then compiles the *.res to a *.dll as needed. I put the following in the Pre-Build event section for my project.
C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res

KABOOM! Error 1 The command “…” exited with code 128.

So looking at the properties for the CLT, here’s what is called when I click it:
%comspec% /k “”C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat”” x86

OO…a batch file, let’s take a look at it. Since I’m on an x86:
call “%~dp0bin\vcvars32.bat”
(C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat)

More batch files? Keep them coming!
(C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat)

FOUND IT! Well, it’s the end of the road here, so I copied the entire batch file contents and pasted it before the call in the Pre-Build event. Worked like a charm…now I need help with finding out what is the right approach to doing this using best practices. Meanwhile, I’m going to hack this section up and minimize the calls and settings to let it keep working.

(10:54:43 AM) kashifkhan17: yup env settings it was
Thanks, Kashif! For helping me think through it.

Why is Blogger Messing Up?

December 26th, 2007 § 1 comment § permalink

I’m currently trying to republish my blog’s atom.xml file, but it only produces the static HTML files and respective folders. The list of files Blogger says it successfully publishes is blog/atom.xml. I log in my FTP and there are only HTML files! I deleted the entire folder, just in case, and republished…ONLY HTML files.

I don’t know what’s up. It sucks.

First Month on the Job.

December 14th, 2007 § 0 comments § permalink

What have I been doing? My first week was great and it just keeps getting better:
1. Put all code (legacy too) in Subversion.
2. Dug my hands into two projects, one new and one old.
-Include effective debugging, documentation and unit testing.
3. Got approved for training I found through blogs I read.
-Hopefully, David can go on Devon‘s tab too!

I’m currently working on a VBScript/COM project. It’s not too bad, but I can’t seem to get away from classic ASP and VBScript ever since I got my hands on it at Motion Grid about six years ago.

Deng, I just realized that I’ve been developing for six years, both professionally and as a hobby. I’ve changed so much as a developer and it’s just getting started.

Time for work now…

Where am I?

You are currently viewing the archives for December, 2007 at thomas nguyen.