Archive for February, 2009

Published by Rolf on 28 Feb 2009

How to set up remote debugging with VS 2008

As per the MSDN directions:

  1. On the test machine to be debugged, create an account with the same username and password as the development PC, and log in as that user
  2. Make sure you have the program to debug saved to the remote PC (you can’t run it from the development PC)
  3. Copy the directory in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86 to the test machine to be debugged
  4. start msvcmon.exe. If you get a warning about “Network access: sharing and security model for local accounts”, then:
    1. Close out of msvcmon.exe
    2. go to Start->Programs->Administrative Tools->Local Security Policy
    3. Go to Local Policies->Security Options
    4. Under “Network Access: sharing and security model for local accounts”, right-click for Properties and choose “Classic – local users authenticate as themselves”
    5. OK out and restart msvcmon.exe
  5. If you get prompted to “unblock remote debugging”, select the local subnet, and click OK
  6. On the development PC running Visual Studio, load up the project to debug and go to Debug->Attach to Process
  7. On the Qualifier poplist, click “Browse…” and browse for the remote PC. You may get a warning that the firewall needs to be configured to allow the connection. If so, click Yes.
  8. If you get prompted to “unblock remote debugging”, select the local subnet, and click OK

You should now see the processes on the remote PC, in the list so you can attach the debugger.

Published by Rolf on 28 Feb 2009

Migrating Joomla 1.0.x to a new server

I didn’t want to do a new install; just wanted to keep everything as-is so I could set up a dev environment. This was going from Linux to Windows, vice versa is probably the same:

  1. Copy the following directories:
    1. administrator
    2. components
    3. editor
    4. images
    5. includes
    6. language
    7. mambots
    8. templates
    9. files in /
  2. Update configuration.php with the following:
    ...
    $mosConfig_absolute_path = 'C:/.../path-to-webroot'; 
    $mosConfig_debug= '1'; // useful if you want it
    $mosConfig_error_reporting = '1'; // useful if you want it
    $mosConfig_password = 'newpassword';  // db password, looks like this may be hashed though
    $mosConfig_user = 'new-db-username';
    ...

Hope this helps. Good luck!

Published by Rolf on 28 Feb 2009

Playing FLV files with Windows Media Player 11

Thanks to afterdawn for these directions:

  1. Install FFDSHow as per the directions. In the installer, check MP3 for audio; defaults are otherwise OK.
  2. Install Gabest Flash Video Splitter v1.0.0.4, also available at the above link.

When you open an FLV link in WMP you’ll get a warning that it doesn’t recognize the extension, but the file will play.

May come in handy for the Media Center project…

Published by Rolf on 28 Feb 2009

Creating a new PHP project with VS.PHP

This has tripped me up a dozen times, and I keep having to relearn it. To make a new project from an existing codebase (the most common scenario), follow these steps:

  1. Add new project
  2. Under “PHP Projects”, click “new project in existing folder” and name it
  3. Browse to location where your PHP files are
  4. Under “ignore directories”, uncheck “.svn” if it’s there. Leave everything else checked. This is the opposite of what you’d expect, and it seems like a bug to me.
  5. Chances are, the VS solution file was created as My Documents/Visual Studio 2008/Projects/PROJECTNAME/PROJECTNAME.sln. You probably want to move that to a location along with your PHP files if they’re located somewhere else.

This may well be fixed in the current version of VS.PHP, these directions are for version 2.4.

Published by Rolf on 27 Feb 2009

Building a Vista Media Center plugin

All I want to do is watch hulu.com movies on my TV instead of my laptop. This is much easier said than done though. The development tools seem to have stalled a few years ago. Is anyone else writing these things these days?

This post gives bad news: Flash is not coming to MCE anytime soon. So in order to get the Flash videos playing you have to render the ordinary Flash object inside a page, and have the plugin navigate to that page.

First off, I’m not the only one doing this. TunerFreeMCE, a closed-source plugin written by the author of the blog above, does the same thing for BBC shows and Hulu. Unfortunately it seems broken at the moment for Hulu content, but that’s probably easily fixed. Perhaps they changed their HTML format or something.

Main things I learned in the writing of my first plugin:

The Media Center SDK version 5.3 (which I think is the latest) has some issues.

  1. It contains a solution (MCMLSampler) that doesn’t build in VS 2008. It can’t find any of the MediaCenter DLL references, and try as I might I couldn’t add them manually either. So you can use the solution to browse the code but you can’t build it.
  2. There are hardcoded WiX binary paths in the MSI build batch file Build.bat. Sloppy, Redmond!
  3. Don’t forget to edit DevInstall.cmd if you add any non-DLL’s to your plugin; otherwise they won’t get copied to Program Files.
  4. DevInstall.cmd /u /debug works but DevInstall.cmd /debug /u does not.

The design and debugging process leaves a lot to be desired.

  1. I haven’t found any way to F5-debug the application directly. I can install the plugin into MCE via DevInstall.cmd (which installs it into the GAC) and then attach to the process but that’s it. If you set the registry key in C:\Program Files\Microsoft SDKs\Windows Media Center\v5.0\Tools you end up spawning a dialog window upon launch to give time to attach to the process. This post recommends a macro to make it quicker but I haven’t tried it.
  2. You can debug your markup via F5-debug but it will crash if you have any code-behind dependencies. This makes it fairly useless IMHO.
  3. There’s no visual designer (at least that I’ve found). So you have to lay out the markup manually, like in the early WPF days. And when you don’t have any good-looking templates to start from, the results look like crap.
  4. I did find the MCMLookalike project to develop open-source templates plugin developers could use to better match the MCE UI. It ceased last year due to a lack of community support but it was really helpful to see how a good MCE developer would write the MCML. You have to dig for the source code, but it’s there. I had to rebuild the VS 2008 project to get it running; that’s available here: mcmlookalike-vs2008.zip
  5. You can set several command-line options in MCMLPad during debugging. I added screen resolution, for example, so in the “Command-line arguments” under the Debug tab, I have the following to test 1280×720 (what the default “windowed”) launch of MCE is on Vista):
  6. -load:"resx://HuluMCE/HuluMCE.Resources/Test" -assemblyredirect:"C:\shared\projects\hulu\HuluMCE\bin\Debug" -markupredirect:"resx://HuluMCE/HuluMCE.Resources/,file://C:\shared\projects\hulu\HuluMCE\Markup\,.mcml" -size:1280,720

When I get a bit further along I’ll post the code, and built project, so you can see it in action.

Next »