Hallelujah moment

I’m sure it will be short-lived rejoicing, and most of the people reading this have not a clue what any of this means, but I got my IE plugin to run on the “normal user” using “Run as administrator” in Vista rather than having to log into the special “Administrator” account. What does that mean? Likely that I can stop switching back and forth between two logins on Vista and just stay as the normal user.

You know what gets me though? The whole time it turns out the problem was apparently the plugin was disabled using the IE plugins manager (some time ago by me), and Netbeans isn’t quite smart enough to detect that the plugin is disabled and tell you you’re trying to do something stupid that you shouldn’t expect to work.

HTTP Monitor

You know what’s fun about writing an HTTP monitor? Testing it basically requires surfing the internet. (c’mon that’s got to be a major plus, right?)

You know what’s not as fun? Creating an infinite loop in your internet explorer plugin that causes your system to go completely erratic and unstable without completely crashing. I ended up with three task-managers one of which was completely erratic and not actually showing correct performance. Needless to say, reboot was quite necessary at that point.

I’m actually making quite a bit of progress. Earlier this week with Q.’s help I figured out why my faked headers weren’t showing up in Netbeans (apparently there was one more spot the feature had to be enabled for IE). And since then I’ve been working on getting real headers into Netbeans rather than fake ones, and that basically means writing code to parse strings in C++. Parsing strings in C++ is not fun, its not nearly as easy as in Java. And its a lot more difficult to do in a non-MFC project where you can’t use CString, it requires going back to the <string.h> library functions, except there’s a bunch of quirks like the function that would seem obvious to use doesn’t really do what you need so you have to do it a different way. But every time I get a new header to show up in Netbeans correctly its great fun, and for some reason IE doesn’t put all the headers in one place so I’ve been getting them added in little chunks and it just looks closer and closer to working properly, at least for the general case with no bad data or anything.

A Breakthrough

Do you have any idea what this means?

It means I am 9/10 of the way there on finding a solution to my impossible problem 🙂

And here yesterday I left the office feeling frustrated, in over my head, like I was trying to solve an impossible problem, and there was no way I was going to figure this out on my own.

Today, I spent pretty much all day looking at Igor’s PassThruApp sample code, trying to get his example to build and then deciding that was sufficient for solving my problem without the “kitchen sink” thrown in, and only a handful of files to deal with, and tried to mangle that code into my code…and finally end of the day today I’m displaying pop-ups with the HTTP request and responses, now I just need to send the IDE those values instead of displaying them on testing pop-ups and do a bunch of renaming and other clean up.

Netbeans HTTP Monitor

I’m working on a somewhat difficult (as in hard to solve) problem at work. We want to add Internet Explorer to the HTTP monitor in Netbeans.

Netbeans is an “IDE” or “editor” for writing computer programs or web applications. The HTTP monitor feature shows you all the HTTP headers (not to be confused with HTML headers) that the broswer sends to websites you visit and the sites send back to your browser, before it sends the actual webpage. The headers include things like whether or not the page you’re trying to view really exists, whether it hasn’t changed since the last time you viewed it (so your browser can load it faster by using its cache) and what website you came to that website from and a bunch of other stuff…most normal people wouldn’t care about what’s in the HTTP headers, but if you’re a web-developer trying to debug a complex web-application, it could be helpful diagnostic information. Right now our HTTP monitor only supports Firefox. But now I’m working on trying to add that same feature for IE.

So basically…for me, that means, I have to figure out how to get the HTTP headers out of IE. That’s the hard part. We already have a “C++ COM DLL” that intercepts page requests to do javascript debugging, but this new part you have to go a bit deeper into the browser communication and get down to the level where IE sends HTTP requests, several layers down in the browser architecture slide.

I’ve been doing a lot of internet searching. And most of that searching has gone nowhere. Other than a few people have written expensive closed source programs that monitor IE’s HTTP headers, so theoretically *what* we want to do should be possible, but not a lot of help on the *how*. And being a closed source browser, its not as easy to “hack into” as firefox. Even just doing javascript debugging, where firefox requires some javascript, IE requires a DLL written in C++ with lots of COM calls (and if you don’t know what that means, just think…its hard to read and understand ugly stuff to code).

But finally, today I’ve come across something slightly promising, a full demo-app on CodeProject.com that includes HTTP monitoring as well as the kitchen sink of other unrelated features I don’t need. The important part for me is it includes the full source code including their “C++ COM DLL” (notice how this is the same type of DLL we have? ;-)) that intercepts the requests the browser sends and acts as a pass through, mangled in with some code to be a download helper app stuff I don’t need.

On the upside this is promising because if I could understand this code, I could probably figure out exactly what I need to do to to add my new feature to our app. But the downside is that even with a several page long article on CodeProject about that app, they actually don’t document almost anything about the part I’m interested in. And the source code is extremely cryptic because it uses all these obsure programming constructs/libraries/something? like ATL that I barely know what the acronym means, and I certainly haven’t read the 500 page book on it that my coworker left me…

Its kind of like a puzzle where I’m trying to crack this code of deciphering cryptic pages on MSDN like “How to get Protocol Headers in a Pluggable Protocol Handler” which might be a little more obvious if I were a Microsoft Programming Guru (course, if I were, I’d probably be working for Microsoft or as a consultant selling my knowledge about these cryptic technologies at an obscene hourly rate…one of the other reasons those who “understand this stuff” don’t just post lots of articles all over the internet about how to do what I want to do…) so that I can figure out how this stuff works to mangle it into something different…while not recycling any code that is not appropriately licensed to be reused in an open source app (eg: big no no to recycle GPL code because GPL license requires the resulting product to also be released as GPL, which is a different license than the one we’re using) according to the legal department 😉

Transfer of Responsibility

I’m not sure if I mentioned this on the blog before or not..but toward the end of last week, I found out I’d be taking over the project of one of the guys on our team who’s going on a long vacation starting Friday…

He wrote the internet explorer javascript debugger plugin for Netbeans, (a C++ COM project in Visual Studio)…that’s the part I’m going to be taking over.

And then it turns out, he’s not actually just going on vacation, he’s not coming back after his vacation either…so double the fun, “make sure to ask him lots of questions before he leaves” my boss says.

Its a lot to jump into, code-wise, a bunch of stuff I’ve never even looked at before, and such a short time to learn it and sometimes its difficult to even know where to start with questions, or what would be the most fruitful things to discuss or study in the couple days left before he leaves, especially with the double learning curve of not having the background on the Netbeans side of the script debugger either. Time to cross my fingers and pray all goes well…