I often open a file and go to location from a stack trace. It gives information in the following format:
filename:line 999
Here's the macro that I'm bound to Ctrl-Shift-O (because I don't open projects from shortcuts and it is close to Ctrl-O for opening a file).
======
Sub OpenFileFromStackTrace()
Dim ret As String = InputBox("Input filename and line number (example=> c:\myfile.cs:line 321):", "Open File From Stack Trace")
If (ret = String.Empty) Then
Return
End If
Dim spl3 As String() = ret.Split(New [String]() {":line "}, StringSplitOptions.None)
DTE.ItemOperations.OpenFile(spl3(0))
Dim line As Integer = Integer.Parse(spl3(1))
DTE.ActiveDocument.Selection.GotoLine(line, False)
End Sub
================
Monday, December 21, 2009
Thursday, September 03, 2009
The case of the mysterious window popping up
At work one day my difference tool stopped working when launched from the source control system. This applies to any large tool that's launching a 3rd party tool.
The source control system did not specify what the command line it was launching. Time for a bit of reverse engineering...
1. Launch the source control tool
2. Run filemon
3. Launch the difference tool
Take a look at what filemon was trying to open. In my case it was a tool called "compare.exe".
Hmm. Why would that fail.
I ran the compare.exe from the command line (cmd.exe) and bingo it came up with the other 3rd party tool (in my case it was ImageMagick's compare.exe). As I don't use ImageMagick too much I just renamed the binary on my system to imcompare.exe and I was in the money again running my difference tool happily.
The source control system did not specify what the command line it was launching. Time for a bit of reverse engineering...
1. Launch the source control tool
2. Run filemon
3. Launch the difference tool
Take a look at what filemon was trying to open. In my case it was a tool called "compare.exe".
Hmm. Why would that fail.
I ran the compare.exe from the command line (cmd.exe) and bingo it came up with the other 3rd party tool (in my case it was ImageMagick's compare.exe). As I don't use ImageMagick too much I just renamed the binary on my system to imcompare.exe and I was in the money again running my difference tool happily.
Labels:
filemon,
reverse engineering,
technical problem
Wednesday, June 24, 2009
Tuesday, October 21, 2008
Tuesday, September 23, 2008
Chrome under Windows 2003 Server
Chrome works well under Windows 2003 server except in one small case. When composing an email in Gmail when you press tab the "Send" button should highlight and it doesn't. This is because the Theme engine is using the Windows Classic style. In order to change this run the Theme service (Start>>Run>>services.msc>>find "Themes" and change it to "Automatic" startup type and press start). The Display Properties "Appearance" tab for "Windows and buttons" will now allow you to change it to "Windows XP style". This style shows the highlighted buttons.
Monday, September 15, 2008
What you can do when your browser is a lot faster
Well, Chrome has changed the landscape and TraceMonkey from the Firefox team is also making a dent in what is possible with browsers.
Here's a really cool demo that only works on the latest Firefox 3.1 builds and apparently Webkit nightlies.
Image Manipulation in browser
Here's a really cool demo that only works on the latest Firefox 3.1 builds and apparently Webkit nightlies.
Image Manipulation in browser
Thursday, August 21, 2008
WinMerge in MKS Diff and Merge Tools
I've done this integration a number of times and I've always had to resort to creating a C# program to discover what the options really are:
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine("[" + i + "]: " + args[i]);
}
Console.Read();
}
}
then I hook it up to the dialog and do a diff.
Here's the current options that I've put in:
C:\Program Files\WinMerge\WinMergeU.exe /maximize /e /x /ul /ur
/dl "{1}" /dr "{2}" "{3}" "{4}"
Subscribe to:
Posts (Atom)