WGS v0.3 – having problems

19 October 2007 ,    1 Comment

WGS v0.3 was supposed to demonstrate the possibility of having in game chat (XFire’s main feature) via notification of when you got a message in game (just a little overlay would popup). Unfortunately, I’ve not been able to get that to work, because I can’t seem to load additional DLL’s – signed or not – in WLM. The library I was playing to use to handle the overlays is Muhammad Haggag‘s DirectDrawOverlayLib, which is a managed wrapper around unmanaged code.

Unfortunately, when trying to execute the code (any of the code…in this case, just creating an object of one of its types) I get errors. Specifically, using VS2008 Beta 2 to attach to MSNMGR.exe to debug, I get

The type initializer for ‘<Module>’ threw an exception.

The inner exception is:

{“Could not load file or assembly ‘msvcm90, Version=9.0.20706.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0×80131417)”:”msvcm90, Version=9.0.20706.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”}

At the moment, my theory is that the unmanaged code is causing the issue. I was able to get a separate C# library (“hello, my name is test”) to function. I’m guessing msvcm90 isn’t in the GAC (since it has native code and all), so WLM is kicking up a fuss.
Unfortunately my attempts at removing the dependency on msvcm90 have so far been unsuccessful (they result in a few fatal errors), probably due to the nature of the library. If I can’t get this to work, I’m in way over my head trying to get it to work using purely managed DirectX, so it’ll cancel the project to some degree :(

When I discovered the performance hit in v0.1/0.2 because of WMI process watching, I decided I’d not release v0.3 until I’d fixed that at the very least. Unfortunately, I’m not really sure where to begin on that, so while it is on its way, it is being pushed onto the backburner for awhile.


 

WLM GameStatus v0.2

29 September 2007 , ,    2 Comments

Update: Updated binaries and source code now available from Codeplex!

Okay, I said I’d have a bug fix out yesterday, but I didn’t get to it. On the plus side, it now uses DDE (see below), which is so much more cooler. I haven’t added any other game support, but opening the XML file is easy as usual.

Changes

Bug Fixes

What can I say? It is a minor point release ;)

Download v0.2

For installation instruction, read the previous post on WGS


 

WLM GameStatus v0.1

27 September 2007 , ,    3 Comments

Update #2: Updated binaries and source code now available from Codeplex!

Update: this has been updated, I recommend you get the latest version by visiting the front page.

I’m a gamer, and I use Windows Live Messenger (why does this sound like an AA meeting?). I dislike it when people will start spamming talking to me asking questions like ‘whatcha up to?‘ while I’m playing a game. So, WLM GameStatus (WGS) will automatically set my Personal Message (PSM) to the name of whatever game I’m playing, and then revert back to what I had it when I close the game

Installation

Installation is a bit convoluted, since WLM Add-in support isn’t automatically enabled, that has to be done through the registry (step 2 & 3)

  1. Download and extract Zip file
  2. Open up RegEdit.exe
  3. In HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger, set AddInFeatureEnabled to 1
  4. Create HKEY_LOCAL_MACHINE\SOFTWARE\Aeoth, add a new String Value called Location. Set the value of ‘Location’ to where you extracted the dll and xml files (ie, D:\wsg0.1)
  5. Install the DLL into the Global Assembly Cache – drag and drop it into C:\Windows\Assembly or from commandline, gacutil -I wgs.addin.dll
  6. Run Windows Live Messenger, Options, Add-ins, Find the DLL, Click ‘Settings’, Detect Games. Close that settings window
  7. Use the drop down where you set your ‘status’, and you should see a “Turn on ‘WGS’”. Select that.
  8. Play game

Supported Games

So far I’m only ‘supporting’ games I’ve got installed – mainly ’cause they’re the only ones I can test.

If you want to add more games support, edit gamesdatabase.xml (and then run detect games again) or detectedgames.xml. Feel free to add the details of other games in the comments

In vNext (or I should say, features I’ll try and add over many versions) my plans are

Disclaimer

While it shouldn’t damage anything, if it does, its not my fault. It should be used ‘as-is’, and at your own risk.


 

Painful coding

23 July 2007 ,    No Comments

Do you know its really hard to code anything while you are in pain?
A lot of ‘geeks’ suffer from RSI at some stage, others just deal with debugging mutlithreaded programs. Me? I deal with Chronic Headaches. All day, every day.

At the moment I’m trying to setup a debugging enviroment so I can step through a different POP Library to see how I can access the message body effectivly.
It isn’t a hard task by any means, but with headaches, everything is ‘blocked’. It’s like UAC – only the way Apple describe it in the ‘I’m a PC and I’m a Mac‘ ads.

For example, I know I need to:

But when I actually go to do that, this is what happens:

and so on and so forth.

Thats all before I get to the actual applicationg programming part, where I have to think about algorithms and whatnot. That’s becoming increasingly difficult to do as I live with headaches. Maybe I should give up programming and go into media, since people have been calling me a ‘graphics artist’ lately anyway…

Sigh, this bites, I’m going to lay down.


 

Moving from PHP to ASP.NET

PHP

PHP is for many people (when it comes to ‘web languages’) their bread and butter, for others its what they started it before moving on to bigger and better things.
This is a combination of cost, ease of learning/use, and availability of the platform.

PHP wasn’t the first web language for me (funnily enough, “Classic” ASP was, but thats only because thats what my free webhost offered at the time), but I’ve spent a substantial amount of time working with it. I’ve created blogs, forums, as well as a myriad of other ‘scripts’.

My choice of “LAMP” (Linux + Apache + MySQL + PHP) as my platform has been pretty simple: cost and availability of material.
Finding a webhost that offers decent amounts of storage and bandwidth for a small price (unemployed disabled student here…) is really easy. Finding the learning material for PHP is even easier, as not only does any search enginge turn up huge amounts of results for free PHP tutorials, but it was what 90% of my friends were using at the time. However, while developing a reasonably large site by myself (ANZGW), I began developing my general programming skills (such as realising when OOP would really come in handy) and at the same time, I began to notice some of the downfalls of PHP.

  1. OOP in PHP sucks. PHP5 improved things (both what was available such as method/attribute visibility and performance) in OOP substantially, but unfortunately, it still sucks. The biggest problem with OOP in PHP, to me, is the lack of method overloading (yes, I’m aware of the ways to can achieve it, but its messy).
  2. Despite all the hardwork that was done with PHP5, there was one massive flaw in PHP they failed to address: incosisitent naming of functions. I understand the reason they kept everything named the way it was (compatibility), but its a nightmare to try and remember all of any languages inbuilt functions when there isn’t a common naming convention.
    What do I mean? Well, say you want find the position of a character in a string, you use strpos(). That part is easy to remember, string is str, position is pos. strpos()!
    What if you then want to replace part of a string? Going by the previous logic, it’d have to be strreplace(), right? Wrong. Its str_replace()
  3. There isn’t a decent IDE out there for PHP. AptanaIDE, NuSoft’s PHPEd, Zend Studio, etc all suck. Most of the time they’re slow to launch, have a poor interface, run slowly (since they’re mostly multi-platform, they’re written in Java,which means they loooove their horrible GTK-esque themes on Windows).
    If you’ve ever used one of these products, and the ‘Intellisense’ wasn’t horribly slow, I’d say you’re lucky. For me, they’d usually take several seconds to popup, which in that time, I can type the entirety of the function myself.
    It got to the point that all I could use was Notepad++ which only has syntax highlighting, but is fast and more stable than the others.
  4. No Namespaces
  5. Caching/compiling/whatever you want to call it isn’t the default.

ASP.NET

It just so happened that my next project I was playing with was going to be a desktop application, .NET sounded a lot better than learning C++, so I went with C# as I like its general syntax more than VB.NET.
The first thing that hit me when playing with .NET was the IDE. In a word, wow. Easy to use, incredibly fast Intellisense…just wow.
The next thing as I started to get a bit further into my program was that it was a proper programming language, compared to the ‘work in progress’ which is PHP.

In the last week or two I’ve started to move into ASP.NET (only 2.0, not 3.0 for now ;)). WebControls – especially databound WebControls – are just so amazingly simple to implement (at least basic implementation) yet so effective. The default is a two-tier application (aspx and its code behind file)…I think I’m in love!
I can programmatically access controls? Wow.
Master pages in addition to themes mean I don’t have to implement my own theming engine (for now, at least. I’ve heard reports that Master Pages don’t go far enough), or more importantly and unlike PHP, I don’t have to implement somebody elses and learn their weird template tags.
I think the two controls I’ve just thought ‘cool’ to so far are the Wizard and GridView controls.

Don’t get me wrong, there are a few things in ASP.NET which don’t seem…right.

PHP vs ASP.NET

One of the most interesting things in the “PHP vs ASP.NET” debate (religious war almost…) is the learning curve.
If you’re looking at ASP.NET or PHP to learn, and you have some programming background (preferably with C/C++ style syntax), you’ll see PHP and after a few minutes you’ll know how to output a variable, or do a myriad of other things. PHP starts off very ‘easy’, and you feel ‘in power’, partially because there is but a single PHP file.

ASP.NET on the other hand, looks incredibly daunting, as you don’t just have to figure out C#/VB.NET, you have to figure out these ‘WebControl’ thingies, as well as where you can actually put your code, how it interacts with the presentation layer, etc.

However, after that initial hurdle, there is a lot less of the ‘hack/script’ approach there is in PHP when you get to the more advanced concepts like OOP, because .NET is built to be an OOP environment.

learningcurves.png

Apart from the learning curves, I think the next big problem people have when deciding PHP or ASP.NET is the cost.
PHP is inheritable notepad (or basic text editor is what I’m getting at) based. ASP.NET, because of its complexities from the begining of its cycle, thrives in a proper IDE – thats why Visual Studio exists. Unfortunately, Visual Studio 2005 can cost a lot, depending on what version you get.
However, there is a very feasible solution to this: the Express versions of Visual Studio are free.
For some reason (PHP Fanboy cloud?) I just wasn’t aware of them, but they do exist, and aren’t horribly crippled or out of date.
There are also other IDE’s, such as SharpDevelop, but I personally like Visual Studio, so I’ll stick with that.

Apart from IDE costs (or lack thereof), ASP.NET really requires IIS/Windows Server. If you do a quick comparison, Windows Servers are much more expensive for what you get (I’m talking about the shared webhost environments, which is all I can afford/need at this stage).
My .NET hosting is with NetLogistics, who also happen to have Linux hosting. On their most basic plans for each (which both cost AUD$19.95/month), you get the same bandwidth/disk storage, but on the Linux plans you get more domains available to you.
Not a big deal, but if you look at other hosts (US in particular), Linux shared hosting can net you gigabytes more storage/bandwidth for the same price of any .NET host.

The solution isn’t as clear cut as the IDE issue. Yes, Mono exists (gives .NET to Linux), but it does have some limited features, and the uptake of Mono is disappointing to say the least.
While the differences are minimal (the libraries you include), you can’t develop for both Mono AND “Microsoft” .NET. Although I doubt it will ever happen, perhaps mod_dotnet needs to be created by Microsoft, but from a business point of view, that cannot be incredibly attractive.

Conclusion

Overall, I think there is probably a place for both PHP and ASP.NET.
ASP.NET seems to be a bit of overkill for smaller sized projects (or for things that simply don’t need OOP). That doesn’t mean PHP can’t be used on large projects – there are many frameworks which improve its maintainability when it scales, its just…it probably will never scale as well as ASP.NET.
I’ll probably develop in both. ASP.NET while I can (although, I’m still very much in the learning process, so I may discover something I don’t like), and PHP when its the only option because of time/money/server resources/etc.

If you intend to learn ASP.NET, check out Programming in ASP.NET Third Edition, its a fairly straight forward book which while it assumes you have a decent C# knowledge, doesn’t actually require you to be a .NET expert.


 

ReMIX07

remix.png

Why it’s time to rethink & ReMix

On the frontiers of the Web, the boundaries are blurring: between developers and designers; between advertisers and publishers; between software and services; between media and technology; between TVs and PCs; between producers and consumers. The old order is getting a little mixed up.

ReMix is Microsoft’s conference for cutting-edge web professionals designing and building next-generation experiences through Silverlight.

With capabilities never experienced before, Microsoft Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web while bridging communication gap between designers and developers.

(from http://www.microsoft.com/australia/remix07/about.aspx)

Held at Crown Palladium Promanade, ReMIX07:AU was an interesting event, Will and I tagged along to various things together.

Day 1

Day 2

Unfortunately, I was so wrecked after day one (I didn’t get home till 11pm or so!), I didn’t bother bringing mums laptop with me on day two, so I didn’t write that many notes/can’t remember too much of it.

Day two, however, saw me bring along my Foam Blue Monster.

Nick Hodge snapped that photo while Will and I were playing Gears of War on the Xbox 360′s setup. Just for the record, I won most of the games ;)
I’ll get some better photos of the Blue Monster when I get home.

Overall…

ReMIX07 was a lot of fun. All of the presenters seemed to be very passionate about what they did/presented, which is a good start.
The presentations were of pretty good quality/design, although it wasn’t hard to tell the difference between ‘designers’ (or ‘devigners’ I guess) and ‘developers’ presenting.

Next year, it really needs free WiFi setup, as well as more powerpoints to recharge laptops. Those with laptops want to be able to fire up their computer, get to a Microsoft portal where we can download the slides (and maybe even the examples) so that we can compile whatever is on the big screen on our own computers – just so we can see it really work.

It wouldn’t hurt if they had fewer sessions that went for longer so they could cover the content a bit better.

I wouldn’t complain about better ‘free software’. MIX in Vegas got Expression Studio (and a ‘unique’ cover for each attendee no less) and Vista Ultimate (and random other goodies like a pen and memory stick). By comparison we got Expression Web, which is fairly hit-and-miss product.
I’m not trying to suggest that the only reason I went to ReMIX was for the free stuff, but its hard to get excited about Expression Web when the major session on it made it seem pathetic (which backed up my thoughts on my previous trial of Expression Web). If they had of given us Expression Blend, on the other hand, I would have been ecstatic as its a fantastic product.

Nick Hodge has a good round up of many ReMIX blog posts for those who are interested.

My apologies for posting this a week late, I’ve been a tad busy (more blog posts to follow, at around one per day or three). I also took a whole stack of photos, but not many of them turned out too well, so I’ve skipped them.


 

ResizeMode="CanResizeWithGrip" sucks

18 June 2007 , ,    No Comments

One of the great things about WPF is how you’re able to create great looking apps.
One of the sucky things about WPF is how you’re able to create great looking apps suck within the standard WinXP/Vista borders.

It’s not hard to turn off the borders, a simple WindowStyle=”none” in the Window tag in XAML does the job.
The problem is, you then can’t move or resize your window.

Okay, AeothLib takes care of the former, and I was trying to add the latter to AeothLib, when I came across ‘ResizeMode=”CanResizeWithGrip”‘

Fantastic‘, I thought, ‘this is exactly what I want’. That was until I discovered how poor performance it is when ‘AllowsTransparency=”True”‘ is set.
Allowing transparency’s is one of the main reasons you’d use no window style in the first place!

After exams/ReMix/engagement party, I’ll actually add it into AeothLib.

(note, trying out Windows Live Writer Beta 2, as I was in my last post, so apologies for anything that’s extremely screwed up. Too many P’s…. Yay! Scape goats!)


 

YA RLY

31 May 2007 ,    1 Comment

I don’t know how to describe this..

[code]
HAI
CAN HAS STDIO?
I HAS A VAR
GIMMEH VAR
IZ VAR BIGGER THAN 10 O RLY?
YA RLY
BTW this is true
VISIBLE "BIG NUMBER!"
NO WAI
BTW this is false
VISIBLE "LITTLE NUMBER!"
KTHX
KTHXBYE
[/code]

I’ll try with a picture…

Nope, that didn’t explain it.
The above code is ‘LOLCAT‘ – a new programming language – which is part hilarious, possibly part predicting our future.
I might have a play with it if it works with Apache ;)


 

Moving WPF Windows without a titlebar

16 May 2007 , ,    2 Comments

Desktop applications, more often than not, are ugly. Thats where WPF steps in.
You can set wonderful transparencies, colours, irregular shapes, etc, but there is just one problem. Ugly borders.

What do I mean? I mean the border the OS puts on all Windows, be it Vista or XP.

ohsougly.jpg

Its easy enough to turn off, in XAML you just set WindowStyle=”None” to your Window tag. The next problem arises in that you now can’t move your window at all.

This small class (download below) will let you change your Window Style to None, yet still move the window (by grabbing any part of the window).
[csharp]
public class MoveWindow
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0×2;

[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd,
int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();

private Window target;
public MoveWindow(Window target)
{
this.target = target;
target.MouseMove += MouseMove;
}
private void MouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
ReleaseCapture();
IntPtr hwnd = new WindowInteropHelper(target).Handle;
SendMessage(hwnd, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
}
[/csharp]

The usage is pretty darn easy:
[csharp]
new Aeoth.MoveWindow(this);
[/csharp]

I’ve decided to bundle a few of my ‘helper’ classes into one project, so they’re all available in one download. I’ll up up a project page for it later.
Download!


Creative Commons License

This work is licensed under a
Creative Commons Attribution-Share Alike 2.5 Australia License.


 

Breaking Expression Blend 2 May Preview

11 May 2007 , ,    No Comments

I’ve been playing with WPF lately, using Visual Studio and Expression Blend.
For the most part, I’ve really enjoyed learning WPF and C#, both extremely powerful and flexible. This is my first time working with .NET outside of Visual Basic.NET and a Uni assignments (you know, the fantastic ones where they decide to teach you the language, but you aren’t allowed to use advanced things like arrays or collections to solve problems)

My copy of Expression Blend was one of the older beta’s, and I had noticed Blend 2 May Preview was out, so I thought I’d try that.

The only thing I’ve noticed so far is that it includes Silverlight support….oh, and it wasn’t able to display/render my WPF program!

I was greeted with this fantastic look whenever I try and open any of my XAML files:

blenderror.jpg
Crap crap said the Aeoth…

The full error was “Exception: could not load type ‘DebuggingModes’ from assembly ‘mscorlib, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561935e089’ due to value type mismatch“.
The program still compiles fine, but I can’t edit it using Blend at all!

If I had of been learning XAML, I’m sure this would have been fine, but I’ve been learning to use Blend, so I can’t really do anything productively in raw XAML.

Now, when I started writing this post, the mind was going something like “crap crap crap crap, have I lost all my UI work?“.

The only thing that looked a bit weird was a reference (only viewable in Blend, and I didn’t get a screenshot of it) “Microsoft.NET.2.Framework”, or something along those lines.
A little weird, and something I hadn’t added in myself, so I decided to remove it from the project. It didnt’ fix any problems…until I restarted Blend…and I was happily greeted with:

spoiler.jpg
No peeking yet!


 
← Newer PostsPrevious Posts →