Feeds:
Posts
Comments

Archive for June, 2007

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 [...]

Read Full Post »

Custom Draw Toolbar

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 [...]

Read Full Post »

Lazy Value

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() : [...]

Read Full Post »

Does the file exists

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 [...]

Read Full Post »

Nice! C# for_each

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.

Read Full Post »

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 % [...]

Read Full Post »

SMTP Woes

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 [...]

Read Full Post »

WCF

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), [...]

Read Full Post »

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 [...]

Read Full Post »

WPF ListView Theme

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. [...]

Read Full Post »