<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=12803833&amp;blogName=thomasnguyen.com&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=TAN&amp;layoutType=CLASSIC&amp;homepageUrl=http%3A%2F%2Fwww.thomasnguyen.com%2Fblog%2F&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" title="Blogger Navigation and Search"></iframe> <div></div>
home blog contact

Visual Studio .NET 2005's Command Line Tool.
Friday, December 28, 2007
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.

SOLUTION? COPY AND PASTE!
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!
"%VS80COMNTOOLS%vsvars32.bat"
(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.

Labels: , ,

0 comments
Why is Blogger Messing Up?
Wednesday, December 26, 2007
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.

Labels:

1 comments
First Month on the Job.
Friday, December 14, 2007
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...

Labels: , , ,

0 comments





Recent Posts
Reading Material: Writing Secure Code.
No Right Click? Use Shift + F10.
Hurricane Ike Recovery.
CI in SD Conference.
Microsoft ArcReady Event.
University of Houston Alumni Organization.
Arrested Development - Great Show!
NYTimes.com - Double Click a Word, Try It.
Secure Vantage Technologies is Hiring.
SqlException: Invalid object name.

Archives
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
July 2008
August 2008
September 2008
October 2008

Blogger
copyright 2006-2008 | thomasnguyen.com

Google Reader flickr del.icio.us nike+