Index: unk/MacFaceFloat/IOptimusMini.cs
===================================================================
--- /trunk/MacFaceFloat/IOptimusMini.cs	(revision 118)
+++ 	(revision )
@@ -1,105 +1,0 @@
-﻿using System;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Runtime.InteropServices;
-
-/// <summary>
-/// Class1 の概要の説明です
-/// </summary>
-class IOptimusMini :IDisposable
-{
-    protected class Driver
-    {
-        const string DRIVER = "OptimusMini.dll";
-
-        public const int SCREEN_SIZE = 96;
-        public const int SCREEN_BUFFER_SIZE = SCREEN_SIZE * SCREEN_SIZE * 3;
-
-        public delegate void OnKeyDownCallbackDelegate(int key);
-        public delegate void OnDeviceStateChangedCallbackDelegate(int state);
-
-        [DllImport(DRIVER)]
-        public static extern void Init();
-
-        [DllImport(DRIVER)]
-        public static extern void Close();
-
-        [DllImport(DRIVER)]
-        public static extern int IsAlive();
-
-        [DllImport(DRIVER)]
-        public static extern int SendCommand(byte c1, byte c2);
-
-        [DllImport(DRIVER)]
-        public static extern int SendCommandBlocking(byte c1, byte c2);
-
-        [DllImport(DRIVER)]
-        public static extern int ShowPicture(int p_nButton, byte[] p_lpData);
-
-        [DllImport(DRIVER)]
-        public static extern int ShowPictureBlocking(int p_nButton, byte[] p_lpData);
-
-        [DllImport(DRIVER)]
-        public static extern int RegisterEventHandler(OnKeyDownCallbackDelegate dk, OnDeviceStateChangedCallbackDelegate ds);
-    }
-
-    public IOptimusMini()
-    {
-        Driver.Init();
-    }
-
-    public void Dispose()
-    {
-        DisplayOff();
-        Driver.Close();
-    }
-
-    public enum BrightnessLevel
-    {
-        Normal = 0,
-    }
-
-    public bool IsAlive
-    {
-        get { return (Driver.IsAlive() != 0); }
-    }
-
-    public BrightnessLevel Brightness
-    {
-        set { Driver.SendCommand(9, 60); }
-    }
-
-    public void DisplayOn()
-    {
-        Driver.SendCommand(2, 0);
-    }
-
-    public void DisplayOff()
-    {
-        Driver.SendCommand(3, 0);
-    }
-
-    public void ShowPicture(int num, Bitmap image)
-    {
-        BitmapData bData = image.LockBits(new Rectangle(new Point(0, 0), new Size(Driver.SCREEN_SIZE, Driver.SCREEN_SIZE)), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
-        byte[] bmpBytes = null;
-
-        try
-        {
-            // number of bytes in the bitmap
-            int byteCount = bData.Stride * image.Height;
-            bmpBytes = new byte[byteCount];
-
-            // Copy the locked bytes from memory
-            Marshal.Copy(bData.Scan0, bmpBytes, 0, byteCount);
-        }
-        // don't forget to unlock the bitmap!!
-        finally
-        {
-            image.UnlockBits(bData);
-        }
-        Driver.ShowPictureBlocking(num, bmpBytes);
-    }
-}
Index: /trunk/MacFaceFloat/MacFaceApp.cs
===================================================================
--- /trunk/MacFaceFloat/MacFaceApp.cs	(revision 118)
+++ /trunk/MacFaceFloat/MacFaceApp.cs	(revision 119)
@@ -130,7 +130,7 @@
 			}
 
-            //IOptimusMini.OnKeyDownCallbackDelegate oKD = new IOptimusMini.OnKeyDownCallbackDelegate(OnKeyDownCallbackHandler);
-            //IOptimusMini.OnDeviceStateChangedCallbackDelegate oDSC = new IOptimusMini.OnDeviceStateChangedCallbackDelegate(OnDeviceStateChangedCallbackHandler);
-            //IOptimusMini.RegisterEventHandler(oKD, oDSC);
+            //OptimusMini.OnKeyDownCallbackDelegate oKD = new OptimusMini.OnKeyDownCallbackDelegate(OnKeyDownCallbackHandler);
+            //OptimusMini.OnDeviceStateChangedCallbackDelegate oDSC = new OptimusMini.OnDeviceStateChangedCallbackDelegate(OnDeviceStateChangedCallbackHandler);
+            //OptimusMini.RegisterEventHandler(oKD, oDSC);
 
             patternWindow = null;
@@ -139,5 +139,6 @@
             InitializeComponent();
 
-            optimusMini = new IOptimusMini();
+            // x64 Â«Å 32bit È OptimusMini.dll ðÇÝà¤Æ·éÆRG[ÆÈéÌÅ½àµÈ¢NXÉµÄ¨­
+		    optimusMini = (IntPtr.Size == 4 ? (IOptimusMini)new OptimusMini() : new OptimusMiniMock());
             optimusMini.DisplayOn();
 
Index: /trunk/MacFaceFloat/MacFaceFloat.csproj
===================================================================
--- /trunk/MacFaceFloat/MacFaceFloat.csproj	(revision 118)
+++ /trunk/MacFaceFloat/MacFaceFloat.csproj	(revision 119)
@@ -102,4 +102,23 @@
     <UseVSHostingProcess>true</UseVSHostingProcess>
   </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <BaseAddress>285212672</BaseAddress>
+    <FileAlignment>4096</FileAlignment>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <BaseAddress>285212672</BaseAddress>
+    <Optimize>true</Optimize>
+    <FileAlignment>4096</FileAlignment>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System">
@@ -150,5 +169,5 @@
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="IOptimusMini.cs">
+    <Compile Include="OptimusMini.cs">
       <SubType>Code</SubType>
     </Compile>
Index: /trunk/MacFaceFloat/OptimusMini.cs
===================================================================
--- /trunk/MacFaceFloat/OptimusMini.cs	(revision 119)
+++ /trunk/MacFaceFloat/OptimusMini.cs	(revision 119)
@@ -0,0 +1,154 @@
+﻿using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// IOptimusMini インターフェース
+/// </summary>
+internal interface IOptimusMini : IDisposable
+{
+    void Dispose();
+    bool IsAlive { get; }
+    OptimusMini.BrightnessLevel Brightness { set; }
+    void DisplayOn();
+    void DisplayOff();
+    void ShowPicture(int num, Bitmap image);
+}
+
+/// <summary>
+/// 何もしない IOptimusMini を実装するクラス
+/// </summary>
+class OptimusMiniMock : IOptimusMini
+{
+    void IDisposable.Dispose()
+    {
+    }
+
+    public bool IsAlive
+    {
+        get { return false; }
+    }
+
+    public OptimusMini.BrightnessLevel Brightness
+    {
+        set { }
+    }
+
+    public void DisplayOn()
+    {
+    }
+
+    public void DisplayOff()
+    {
+    }
+
+    public void ShowPicture(int num, Bitmap image)
+    {
+    }
+
+    void IOptimusMini.Dispose()
+    {
+    }
+}
+
+/// <summary>
+/// OptimusMini への操作を実装するクラス
+/// </summary>
+class OptimusMini : IOptimusMini
+{
+    protected class Driver
+    {
+        const string DRIVER = "OptimusMini.dll";
+
+        public const int SCREEN_SIZE = 96;
+        public const int SCREEN_BUFFER_SIZE = SCREEN_SIZE * SCREEN_SIZE * 3;
+
+        public delegate void OnKeyDownCallbackDelegate(int key);
+        public delegate void OnDeviceStateChangedCallbackDelegate(int state);
+
+        [DllImport(DRIVER)]
+        public static extern void Init();
+
+        [DllImport(DRIVER)]
+        public static extern void Close();
+
+        [DllImport(DRIVER)]
+        public static extern int IsAlive();
+
+        [DllImport(DRIVER)]
+        public static extern int SendCommand(byte c1, byte c2);
+
+        [DllImport(DRIVER)]
+        public static extern int SendCommandBlocking(byte c1, byte c2);
+
+        [DllImport(DRIVER)]
+        public static extern int ShowPicture(int p_nButton, byte[] p_lpData);
+
+        [DllImport(DRIVER)]
+        public static extern int ShowPictureBlocking(int p_nButton, byte[] p_lpData);
+
+        [DllImport(DRIVER)]
+        public static extern int RegisterEventHandler(OnKeyDownCallbackDelegate dk, OnDeviceStateChangedCallbackDelegate ds);
+    }
+
+    public OptimusMini()
+    {
+        Driver.Init();
+    }
+
+    public void Dispose()
+    {
+        DisplayOff();
+        Driver.Close();
+    }
+
+    public enum BrightnessLevel
+    {
+        Normal = 0,
+    }
+
+    public bool IsAlive
+    {
+        get { return (Driver.IsAlive() != 0); }
+    }
+
+    public BrightnessLevel Brightness
+    {
+        set { Driver.SendCommand(9, 60); }
+    }
+
+    public void DisplayOn()
+    {
+        Driver.SendCommand(2, 0);
+    }
+
+    public void DisplayOff()
+    {
+        Driver.SendCommand(3, 0);
+    }
+
+    public void ShowPicture(int num, Bitmap image)
+    {
+        BitmapData bData = image.LockBits(new Rectangle(new Point(0, 0), new Size(Driver.SCREEN_SIZE, Driver.SCREEN_SIZE)), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
+        byte[] bmpBytes = null;
+
+        try
+        {
+            // number of bytes in the bitmap
+            int byteCount = bData.Stride * image.Height;
+            bmpBytes = new byte[byteCount];
+
+            // Copy the locked bytes from memory
+            Marshal.Copy(bData.Scan0, bmpBytes, 0, byteCount);
+        }
+        // don't forget to unlock the bitmap!!
+        finally
+        {
+            image.UnlockBits(bData);
+        }
+        Driver.ShowPictureBlocking(num, bmpBytes);
+    }
+}
