MySQL default-character-set is Deprecated in Windows Event Log

Current versions of MySQL 5.1.x appear to ship with an outdated default configuration file that generates the following warning in the Windows Event Log upon restarting the MySQL service: The syntax ‘–default-character-set’ is deprecated and will be removed in a future release. Please use –character-set-server instead.

Solution

Perform the following steps to prevent the warning:

  1. Open the MySQL configuration file,
    i.e. c:\Program Files\MySQL\MySQL Server 5.1\my.ini
  2. In the [mysqld] section change the line
    default-character-set=utf8

    to

    character-set-server=utf8
  3. Save the file and restart the MySQL service.

If you use a character set other than UTF8, enter the corresponding value. Do not modify the default-character-set setting in the [mysql] section of the configuration file as it will break mysql.exe.

Resources

A solution to this problem was first posted in the MySQL Bug Tracker.

OnDraw, OnDrawAdvanced in CComCompositeControl ATL Controls

When derriving ActiveX controls from CComCompositeControl the virtual functions OnDraw() and OnDrawAdvanced() are not being called. A look at atlctl.h reveals that OnDraw is called from OnDrawAdvanced, which is in turn called from CComControlBase::OnPaint. The message handler for OnPaint, however, is declared in CComControl, and CComCompositeControl does not chain its message map to CComControl, so that WM_PAINT is never actually processed.

Solution

The workaround is to chain the message map to CComControl from your own control’s message map:

  1. typedef CComControl<CYourActiveXControl, CAxDialogImpl<CYourActiveXControl> > TComControlBase;
  2.  
  3. BEGIN_MSG_MAP(CYourActiveXControl)
  4.     // your message handlers here
  5.  
  6.     CHAIN_MSG_MAP(CComCompositeControl<CYourActiveXControl>)
  7.     CHAIN_MSG_MAP(TComControlBase)
  8. END_MSG_MAP()

Messages not processed by CComCompositeControl will now be forwarded to CComControl, and OnDraw and OnDrawAdvanced should be called as expected.

Other Considerations

If OnDraw or OnDrawAdvanced are still not being called despite the changes described above, make sure that

  • the function signatures are correct, so that they don’t overload instead of override
    1. HRESULT OnDraw (ATL_DRAWINFO &di);
    2. HRESULT OnDrawAdvanced (ATL_DRAWINFO& di);
  • the WM_PAINT message is not intercepted in your or a parent control, i.e. by adding a new message handler to the message maps

References

A solution to this problem was first discussed in microsoft.public.vc.atl.

Disabling SBSCore Service on Windows Home Server

The Small Business Server Core Services (SBCore) that come preinstalled with Windows Home Server prevent the server from effectively running Active Directory, joining an existing domain and sleeping for prolonged periods of time by periodically shutting it down or restarting it. The service itself cannot be disabled in the Services Manager, and it will restart itself if the process is terminated through Task Manager.

This article describes how to disable SBCore permanently.

Requirements

You need to have the following on your Windows Home Server:

Solution

The first step is to suspend the SBCore service process in Process Explorer:

  • Launch Process Explorer
  • Right-click sbscrexe.exe and select Suspend

Once the process is suspended, the service can be disabled in the registry:

  • Launch the registry editor (Start → Run… → regedit)
  • Navigate to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SBCore
  • Right-click the key and select Permissions…
  • Add the local Administrators group, give it Full Control and press OK
  • Press F5 to refresh the view and show all the values under that key
  • Double-click the Start value
  • Change the Value data field from 2 to 4 to disable the service
  • Close regedit

In order to prevent the service from restarting itself, perform the following steps:

  • Open Windows Explorer and navigate to C:\Windows\System32\
  • Right-click sbscrexe.exe and select Properties
  • Select the Security tab
  • Add the Everyone group, Deny all access and ignore the warnings

Last but not least, terminate the suspended process in Process Explorer:

  • Right-click sbscrexe.exe and select Kill Process

The SBCore service should now longer be running or restarting itself.

References

The solution was first discussed in a Speed Guide Forum post in the context of Small Business Server 2003, from which Windows Home Server inherits some of its functionality.

Other Resources

DirectX SDK Version Numbers and Download List

Working with different versions of various game engines on a regular basis, I never seem to have a copy of that particular version of the DirectX SDK required to compile the project.

Below is a list of DirectX SDKs and the corresponding values for D3DX_SDK_VERSION, D3DX10_SDK_VERSION and D3DX11_SDK_VERSION as defined in the d3dx9core.h, D3DX10core.h and D3DX11core.h header files, along with their download links to the Microsoft Download Center.

D3DX_SDK_VERSION DirectX SDK Notes
24 February 2005 DirectX 9
25 April 2005
26 June 2005
27 August 2005
28 December 2005
29 February 2006
30 April 2006
June 2006
31 October 2006
32 December 2006 DirectX 10
February 2007
33 April 2007
34 June 2007
35 August 2007
36 November 2007
37 March 2008
38 June 2008
39 August 2008
40 November 2008
41 March 2009 DirectX 11 Technical Preview
42 August 2009 DirectX 11
February 2010
43 June 2010

Local SMTP Mail Relay with IIS 6.0

Some of the websites hosted on a local computer or home server may require an email server to send out emails. For example, blogs or forums may send out notifications, or personal homepages may provide a contact form. When a local mail server is not available or not desired, a local SMTP relay may be a convenient option to collect and send emails from these websites.

The relay server receives the email from the website scripts and forwards it to a pre-configured email server on your network or the internet. Instead of configuring each individual website to send emails to the outgoing email server of, say, a Gmail or Yahoo account, all emails are simply sent to localhost. This has the advantage that, if the actual remote server changes for whatever reason, only the relay needs to be updated and the website scripts remain untouched.

This article describes how to install and configure a SMTP relay on IIS 6.0.

Installing SMTP Server

IIS already comes with a built-in SMTP server that can be configured to act as a relay. The server is not automatically installed with IIS, but it can easily be added by performing the following steps:

  1. Open Add or Remove Programs from the control panel.
  2. Click on the Add/Remove Windows Components button on the left
  3. In the Windows Components Wizard, double-click the entry for Application Server
  4. Double-click the entry for Internet Information Services
  5. Set the checkbox for SMTP Service
  6. Click OK, OK and Next > to install the component.
  7. Wait while setup configures the components
  8. Click Finish when components wizard is done.

The IIS SMTP Service is now installed and ready to be configured.

Configuring SMTP Server

The next step is to configure the SMTP server as a relay. This can be done by performing the following steps:

  1. Start IIS Manager
  2. Open Properties for the Default SMTP Virtual Server node
  3. Select Access tab
  4. Click the Authentication… button
  5. Enable the check boxes for Anonymous access and Integrated Windows Authentication (Note: if you have particular authentication requirements, you can configure these here)
  6. Click the Relay… button
  7. Uncheck Allow all computers which successfully authenticate… (Note: if you wish to allow computers other than localhost access to the relay, you can configure these here)
  8. Select the Only the list below radio box and click the Add… button
  9. Enter 127.0.0.1 (for localhost) and click OK
  10. Click OK to close the Relay Restrictions window
  11. Select the Delivery tab
  12. Click the Outbound Security… button
  13. Configure the user name and password for your outgoing email server and click OK (Note: this is where the user name and password for the remote email server account goes, i.e. Gmail or Yahoo)
  14. Back on the Delivery tab, click Advanced…, enter the domain name of your email server in the Smart host field and click OK (Note: this is the domain of the remote email server, i.e. smtp.gmail.com)
  15. Click Apply and OK to close the Properties window

The SMTP relay is now fully operational. All emails sent to localhost on port 25 should be forward to the remote email server as configured above.

Notes on PHP

If you use PHP for some of your websites you can configure a default SMTP server to be used for the mail() function by performing the following steps:

  1. Open the server’s php.ini in a text editor
  2. Scroll down to the section [mail function]
  3. Enter SMTP = localhost and smtp_port = 25
  4. Save and close the file
  5. Restart the World Wide Web Publishing Service