You are currently browsing the archives for the Uncategorized category


Ruby does not run with missing _wfreopen_s

I do not know what causes this. But I upload my own build of ruby built with VC9. This must be run in Windows XP.

https://onedrive.live.com/?id=F0D9DDC561F5CF32%212276&cid=F0D9DDC561F5CF32

Firefox keeps asking to set it as a default browser

Run the following command as normal user and as administrator.

firefox.exe -silent -setDefaultBrowser
uninstall\helper.exe /SetAsDefaultAppGlobal
uninstall\helper.exe /SetAsDefaultAppUser

warning LNK4075: ignoring ‘/EDITANDCONTINUE’ due to ‘/SAFESEH’ specification

When you upgraded your VC++ project to Visual Studio 2013 or later(?), this warning appears. It looks like VS failed to upgrade projects properly.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='UnicodeDebug|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <PlatformToolset>v120</PlatformToolset>
    <UseOfMfc>Dynamic</UseOfMfc>

    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>

It needs to add “<UseDebugLibraries>true</UseDebugLibraries>” to your *.vcxproj file. See the following fixed file. In a Release configuration, it needs to set false of this attribute.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='UnicodeDebug|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <PlatformToolset>v120</PlatformToolset>
    <UseOfMfc>Dynamic</UseOfMfc>
    <UseDebugLibraries>true</UseDebugLibraries>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>

BadImageFormatException not handled

This exception occurs when AnyCpu-C# app tries to load X86 assembly in 64bit environment. Change the app configuration to X86 or prepare X64 assembly to load.

Install of VS2017 broke VC#2008 coloader80.dll configuration

Open command prompt with Admin priviledge and do followings.

regsvr32 "%CommonProgramFiles%\Microsoft Shared\VS7Debug\coloader80.dll"

if it fails, do this.

regsvr32 "%CommonProgramFiles(x86)%\Microsoft Shared\VS7Debug\coloader80.dll"

Visual Studio 2017 add a context menu item “Open With Visual Studio” on the shell extension of directory

Remove
HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
and
HKEY_CLASSES_ROOT\Directory\shell\AnyCode
from Registry to delete it.

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

wuauserv is Windows Update Service, I do not know what will happen if wuauserve stops during this service is actually updating OS.

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 1, Keep m_pMainWnd to NULL.
Comment out the following line so that m_pMainWnd is not set.

m_pMainWnd = &dlg;

Method 2, Call PumpMessage to call GetMessage.
Calling PumpMessage until it returns false. After that you can show MessageBox.

while(PumpMessage())
    ;