Alpha version of PMG Connect 2.0. Apart from the visual changes and millions of little changes, the internals have been gutted and put back together in preparation for the new file system features (which are also partially in). Note that, it no longer tries to write to the install directory when launching a Remote Desktop session (noteably a [...]
Archive for June, 2007
PMG Connect Early 2.0
Posted in PMG Connect on June 24, 2007 | Leave a Comment »
Custom Draw Toolbar
Posted in C++ on June 24, 2007 | Leave a Comment »
After WPF, spending time with NM_CUSTOMDRAW seemed like running somewhere, when one could catch a bus. Someday, we may even do it’s like for pleasure.
My problem: I couldn’t get the separators to draw on my owner draw toolbar. Apparently, the NM_CUSTOMDRAW doesn’t send a CDDS_ITEMPOSTPAINT for separators. So, the way to do it is draw your separator over [...]
Lazy Value
Posted in C++ on June 23, 2007 | Leave a Comment »
I wanted to replace a const int with a lazily evalueated int. It had to be lazy evaluated as all that was needed to calculate it was not available when the class is instanciated but was available before the int was needed. I didn’t want to change the code that uses the int. So, I made this class:
template <class T>
class CLazyValue
{
public:
CLazyValue() : [...]
Does the file exists
Posted in C++ on June 23, 2007 | Leave a Comment »
After about 16 years of writing C++ on Windows I’m sure there’s been many an occasion with the need to test if a file exists. Today, I discovered a new way to check!
bool FileExists(const extra::tstring &file)
{
OFSTRUCT of = {sizeof(of)};
return (OpenFile(CT2CA(file.c_str()),&of,OF_EXIST)!=HFILE_ERROR);
}
Where an extra::tstring is declared such (part of my library of code):
typedef std::basic_string<TCHAR>tstring;
Apparently it [...]
Nice! C# for_each
Posted in .NET on June 22, 2007 | Leave a Comment »
The C++ STL for_each is very useful. This C# equivalent is even better:
void Method()
{
// assuming string[] strings;
Action stringAction = delegate(string stringParam)
{
// do stuff with stringParam and whatever else available in Method()
};
Array.ForEach(strings,stringAction);
}
See other ForEaches too.
Glass Bead Look – Photoshop
Posted in Graphics and Photoshop on June 21, 2007 | Leave a Comment »
Interesting: Glass Bead tutorial. My attempt:
Then try say a 300 x 75 strip. Use brushes:
Brush 1: Solid #121212
Brush 2: Gradient#445282 Offset 0%, #29314D Offset 53%, #12131D Offset 95%
Brush 3: Gradient #393F4D Offset 0%, #4A5367 Offset 33%, #5F6A87″ Offset 98%, #626C88″ Offset 100%
Use brush 1 to solid fill lowest layer. On new layer, create a selection on bottom 28.57 % [...]
SMTP Woes
Posted in Network and Ops on June 21, 2007 | Leave a Comment »
Situation: Web server that sends out mail. Configured with SMTP service for this purpose.
Problem 1: Some of emails being relayed by the local SMTP service were failing with “550 not local host gmail.com, not a gateway” (where gmail.com is the domain of the mail in this example). This was domain specific.
Problem 2: Some relay SMTP servers [...]
WCF
Posted in .NET on June 21, 2007 | Leave a Comment »
Platform: Vista using VS 2005.
What You Need To Know About One-Way Calls, Callbacks, And Events
The downloadable sample shows different senarios including a good example of the publisher subscriber patten.
For the samples: SQL Server is needed. Windows Vista features to turn on: IIS (including IIS Metabase and IIS 6 configuration compatibility in IIS 6 management compatibility), [...]
The easiest way to test A COM object
Posted in C++ on June 20, 2007 | Leave a Comment »
This is assuming your COM object is a dual interface object (implements IDispatch).
1) Create a text file with a .js extension (eg: test.js)
2) Load the file into Visual Studio.
3) Put the following line at the top:
var arbiObj = new ActiveXObject(“ArbiCOM.ArbiClassProx”);
where “ArbiCOM.ArbiClassProx” is the prog id of your COM object.
4) VS will have intelisense (bellow type [...]
WPF ListView Theme
Posted in .NET on June 20, 2007 | Leave a Comment »
The Goal: To provide a theme for a standard list view.
Looking for a standard theme source for a ListView to base my theme on, I stumbled on this link: Styling with ControlTemplates Sample. It is a good basis to create a theme for anything.
ListView issues: Load up your new listview with 1000s of rows. [...]