Remove HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode and HKEY_CLASSES_ROOT\Directory\shell\AnyCode from Registry to delete it.
Category: Uncategorized
.NET4 installation fails on XP PosReady
It needs WIC.
LoadLibrary(jvm.dll) fails even if the file exists
It needs an appropriate C++ runtime library to load jvm.dll. Install VC++ 20XX Redistributable.
VMWare : Netwoking of Guest OS is not available after restoring
Stopping network related service will fix it. C:\WINDOWS\system32>net stop bits The Background Intelligent Transfer Service service is stopping.. The Background Intelligent Transfer Service service was stopped successfully. C:\WINDOWS\system32>net stop wuauserv The Background Intelligent Transfer Service service is stopping.. The Background Intelligent Transfer Service service was stopped successfully. C:\WINDOWS\system32>C:\WINDOWS\system32>net stop bits The… Continue reading VMWare : Netwoking of Guest OS is not available after restoring
MessageBox is not shown after Dialog was closed in MFC Dialog Application
In Win32, you can not show MessageBox after calling PostQuitMessage() until calling GetMessage to get out of message loop. In MFC dialog app, the dialog is set to m_pMainWnd and when dialog is closed, PostQuitMessage is called. If you want to show MessageBox after the dialog closed, there is two method to do this. Method… Continue reading MessageBox is not shown after Dialog was closed in MFC Dialog Application
error MSB8020: The build tools for v120 (Platform Toolset = ‘v120’) cannot be found.
Usually you can fix this error by changing tool-set VS uses. But if the Solution includes a reference which uses old too-set, It also fails. Check your reference setting.
Check whether a file is open or not in Win32
There is no easy way to check file is open. I write simple code to check it but it still has problems. Like thread, it is not sure the file is actually open or not at the function returns because file is global resource, any other processes can open or close at any moment. This… Continue reading Check whether a file is open or not in Win32
How to create a C++ function that can take argment of both char* and wchar_t*
Source. Create a traits class that is used as specialized template. Specialize it for char and wchar_t. Generic template is not defined because this function is only for char and wchar_t. #include <wchar.h> #include <stdio.h> template<typename T> struct kansuu_traits; template<> struct kansuu_traits<char> { static FILE* open(const char* p) { return fopen(p, "r"); } };… Continue reading How to create a C++ function that can take argment of both char* and wchar_t*
System global variable in win32
class CSessionGlobalBool { public: explicit CSessionGlobalBool(LPCSTR pName) { m_pName = (LPSTR)LocalAlloc(LMEM_FIXED, lstrlenA(pName)+sizeof(char)); lstrcpy(m_pName, pName); } ~CSessionGlobalBool(){ LocalFree(m_pName); } operator bool() { return get(); } operator =(const bool b) { HANDLE h = CreateEvent(NULL, TRUE, FALSE, m_pName); if(b) SetEvent(h); else ResetEvent(h); } operator =(const CSessionGlobalBool& sgb) { *this = sgb.get(); } private: bool… Continue reading System global variable in win32
Show a “We are Busy” page when your server is too busy by using PHP
If you are apache fan. You shold have many virtual host in your apache conf. But after your site getting popular, sometimes your server can not handle all request and your visitor will have to wait in front of the browser. I could not find a nice solution for that so created one. First, create… Continue reading Show a “We are Busy” page when your server is too busy by using PHP