Sl.ayer's lair

It looks like you're writing a blog...

It is a common task for developers creating add-ons for World of Warcraft to process wow lua files on the server side. YouPVP, for example, receives lua files generated by an add-on and parses battlegrounds data into the database. Since I was building a website on an asp.net platform, I needed lua parser in C#. Unfortunately, after spending some time on the internet, I couldn’t find any .net solutions that would work for me, so I wrote my own. If you need to parse warcraft lua files in a .net environment, I hope you will find my LuaParse class to be useful.


Color picker control for Silverlight

colorpickr

I am a bit of a fan of colors and consequently of color pickers. First release of Silverlight didn’t provide much help with control development and my first color picker was very simple: four sliders, one for each of the color components of RGBA color.

With release of Silverlight 3.0 developers have a choice of the color pickers made by the enthusiasts and companies specializing in Silverlight controls.

Unfortunately, the only kind of color pickers I could find are based on SV+H model. I figure it is due to Microsoft products favoring that type of color picker. Personally, I prefer HS+V color pickers, commonly used in Adobe products, so I had to sit down and build one myself.

Color picker was my first custom control and quite expectedly I ran into some issues during development, but it was a good learning experience.

Color picker is free to use in any projects. Have fun.


Introduction

Did you cheer when you found out that ATL 3.0 would support ActiveX control hosting? I did. This functionality was at the top of my wish list for ATL. ATL 3.0 has finally arrived. What now? In one news group, I saw the following question: "How do I resize ActiveX controls hosted by Composite Control?” The answer to this question is very simple, but the reasoning behind it is not. Therefore, I decided to write this article to share my knowledge of the inner workings of ATL’s hosting of ActiveX controls.

How does ATL implement the hosting of ActiveX controls

If you will look in ATL code, you will notice that code for CComCompositeControl takes less then two hundred lines. How is it possible to fit all hosting support into two hundred lines of code? Well, the answer is quite simple--CComCompositeControl does not have support for ActiveX hosting. The real hero behind the scenes is CAxHostWindow.

CAxHostWindow implements necessary interfaces in order to support the hosting of common ActiveX controls (including windowless) and Microsoft Web Browser control. In case you do not need to host a Web Browser control, you can define _ATL_NO_DOCHOSTUIHANDLER in your project and save about 4K in release dll. CAxHostWindow derives from CWindowImpl, and this means it needs a window to operate. CAxHostWindow can host only one control at a time, and as a result, one CAxHostWindow is required for each hosted control. Without going into all the aspects of implementation (look into atlhost.h for more details), I would like to concentrate here on the way CAxHostWindow handles WM_SIZE and WM_PAINT.

More...

There are two major methods that you can use to support control containment in your control using ATL 3.0. One method is to use the support provided by ATL, namely CAxHostWindow. The other method is to write everything from scratch. By far, using ATL is easier then writing tons of code yourself, but what if CAxHostWindow doesn’t support the functionality that you need? Is following the second method your only option? Most likely, the answer is no. In most cases, the result can be achieved just by extending the functionality of CAxHostWindow, which I will be discussing as the main topic in this article.

The most obvious way to extend the functionality of CAxHostWindow is to modify its code in atlhost.h, but it should be done with care because changes you make will reflect on every user of CAxHostWindow, such as Composite Control. An alternative solution is to derive a new class from CAxHostWindow and override its methods and message handlers. Below, I will demonstrate in more detail how to modify CAxHostWindow to support new functionality.

More...

Introduction

Initially, this article was intended as a tutorial for the creation of ActiveX controls. However, this subject is well covered by articles in magazines and on the Internet. So, instead, I have decided to concentrate on one aspect of control creation, which can make your control look and interact with the user better.

What is Hot Tracking?

For the purposes of this article, hot tracking will be the process when a UI element reacts to the cursor, entering or leaving its extent, by changing it appearance. Hot tracking is not a new concept; it has been used in computer games for years. For example, a game I made five years ago for Windows 3.1 had support for hot tracking built-in as a standard feature. Recently, with help from Internet Explorer, MS Office and other software, hot tracking is becoming a standard in user interfaces. In fact, many UI and non-UI concepts made their first appearance in computer games, but this is a separate discussion. Considering the abovementioned, supporting hot tracking in your control may sound like a good idea. So, without further delay, let's get to the point.

More...

Blog, part deux

This is my second attempt at starting a blog. First one failed due to the lack of time and technological hoops I had to jump through. I have a good feeling about this time.

To give this blog a good start I will publish some of the articles I wrote for my old geocities site. I got my first web site building experience thanks to geocities and it is sad to see Yahoo! closing it down, but geocities didn’t evolve with the rest of the web and weak do not survive in the internet jungle.

And so it begins. Just deux it!