SimanticsExcel interface refresh 49/4149/1
authorAntti Villberg <antti.villberg@semantum.fi>
Mon, 6 Apr 2020 13:53:28 +0000 (16:53 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Thu, 16 Apr 2020 12:28:09 +0000 (15:28 +0300)
gitlab #514

Change-Id: I9c205730f0cbfb8d75f88c69483155dd8cafd4b2

bundles/org.simantics.excel/SimanticsExcel_64.dll [new file with mode: 0644]
bundles/org.simantics.excel/build.properties
bundles/org.simantics.excel/native/Interface.cpp
bundles/org.simantics.excel/native/SimanticsExcel.sln
bundles/org.simantics.excel/native/SimanticsExcel.vcxproj
bundles/org.simantics.excel/native/jni2.h
bundles/org.simantics.excel/scl/Excel.scl [new file with mode: 0644]
bundles/org.simantics.excel/src/org/simantics/excel/Excel.java

diff --git a/bundles/org.simantics.excel/SimanticsExcel_64.dll b/bundles/org.simantics.excel/SimanticsExcel_64.dll
new file mode 100644 (file)
index 0000000..9be7f04
Binary files /dev/null and b/bundles/org.simantics.excel/SimanticsExcel_64.dll differ
index 9a56e9b7ee1106fecc242650952a5d3544c15b89..4f7390681a89be7c1557ccfcedae59524fc12345 100644 (file)
@@ -13,4 +13,5 @@ source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               SimanticsExcel.dll
+               SimanticsExcel.dll,\
+               scl/
index 46f894c63397ded825af1c78a8e008fcd2073dba..9e67f4aa8258bb2ea627b0d5d971e512116fc073 100644 (file)
@@ -1,31 +1,21 @@
 
-//#include "stdafx.h"
-
-//#ifndef _UNICODE
-//#define _UNICODE
-//#endif
-
 #include <sstream>
 #include <map>
-//#include <cmath>
-//#include <TCHAR.H>
+#include <stdio.h>
+#include <tchar.h>
+#include <cstring>
+#include <atlstr.h>
 
 using namespace std;
 
-#import "c:/program files (x86)/common files/microsoft shared/office12/mso.dll" \
-       rename( "RGB", "MSORGB" )
-
-using namespace Office;
-
-#import "c:/program files (x86)/common files/microsoft shared/vba/vba6/vbe6ext.olb" \
-
-using namespace VBIDE;
+// mso.dll
+#import "libid:{2df8d04c-5bfa-101b-bde5-00aa0044de52}"  auto_rename
+// vb6ext.olb
+#import "libid:{0002e157-0000-0000-c000-000000000046}"  auto_rename
+// excel.exe
+#import "libid:{00020813-0000-0000-c000-000000000046}"  auto_rename
 
-#import "c:/program files (x86)/microsoft office/office12/excel.exe" \
-       rename( "DialogBox", "ExcelDialogBox" ) \
-       rename( "RGB", "ExcelRGB" ) \
-       rename( "CopyFile", "ExcelCopyFile" ) \
-       rename( "ReplaceText", "ExcelReplaceText" )
+using namespace Excel;
 
 #include "jni2.h"
 
@@ -34,10 +24,10 @@ using namespace VBIDE;
 
 #define SIMANTICS_DEBUG(...)
 
-using namespace std;
-using namespace Excel;
+//using namespace std;
+//using namespace Office;
 
-map<int, Excel::_WorksheetPtr> handles;
+map<int, _WorksheetPtr> handles;
 static int handleCounter = 1;
 
 void replace(std::string &s, const std::string &s1, const std::string &s2) {
@@ -464,7 +454,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_excel_Excel_close(JNIEnv *env, jobject
 
 }
 
-/**
+
 JNIEXPORT jdouble JNICALL Java_org_simantics_excel_Excel_getDouble(JNIEnv *env, jobject, jint handle, jint row, jint column) {
 
        SIMANTICS_DEBUG("getDouble(%d, %d)\r\n", row, column);
@@ -489,7 +479,7 @@ JNIEXPORT jdouble JNICALL Java_org_simantics_excel_Excel_getDouble(JNIEnv *env,
 }
 
 JNIEXPORT jstring JNICALL Java_org_simantics_excel_Excel_getString(JNIEnv *env, jobject, jint handle, jint row, jint column) {
-
+       USES_CONVERSION;
        //string val = getString(env, value);
 
        SIMANTICS_DEBUG("getString(%d, %d)\r\n", row, column);
@@ -499,30 +489,30 @@ JNIEXPORT jstring JNICALL Java_org_simantics_excel_Excel_getString(JNIEnv *env,
        Excel::RangePtr range = sheet->Cells;
        if(!range) return NULL;
 
-       variant_t val = range->Item[row+1][column+1];
-       if (val.vt != VT_NULL) {  // val.vt seems to be always VT_DISPATCH.
-               try {
+       _bstr_t val = _bstr_t(range->Item[row + 1][column + 1]);
+       //if (val.vt != VT_NULL) {  // val.vt seems to be always VT_DISPATCH.
+               //try {
                        //this call will crash the application, if the cell is empty!
-                       _bstr_t bstrt = val;
-                       TCHAR text[1024];
+                       //_bstr_t bstrt = val;
+                       //std::string text(val);
+                       //CString text(val);
+                       //text.
+                       //TCHAR text[1024];
                        // TODO: this uses wide character (16-bit) while NewStringUTF expext regular character (8-bit), hence Java gets only the fisrt charater of the whole string.
-                       _stprintf(text, _T("%s"), (LPCTSTR)bstrt);
+                       //_stprintf(text, _T("%s"), (LPCTSTR)bstrt);
                        //const char *text = bstrt;
                        SIMANTICS_DEBUG("%s\r\n",text);
-       
-                       // this code returns "??" for all cells.
-                       //BSTR bstr = val.bstrVal;
-                       //const char *text = _com_util::ConvertBSTRToString(bstr);
 
-                       jstring ret = env->NewStringUTF((const char*)text);
-                       delete[] text;
-                       return ret;
-               } catch (...) {
-                       return NULL; 
-               }
-       } 
-       SIMANTICS_DEBUG("%d\r\n",val.vt);
-       return NULL; 
+                       string text(val);
+
+
+                       return env->NewStringUTF(text.c_str());
+
+               //} catch (...) {
+               //      return NULL; 
+               //}
+       //} 
+       //SIMANTICS_DEBUG("%d\r\n",val.vt);
+       //return NULL; 
 
 }
-*/
\ No newline at end of file
index 59c24ad3489255b85d6e2350a786fe753995472a..bb04a663d1eda63c60e1d0568665360f12afcd12 100644 (file)
@@ -1,7 +1,9 @@
 
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimanticsExcel", "SimanticsExcel.vcproj", "{E106958A-412F-4782-81CD-DF380D66BA6B}"
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimanticsExcel", "SimanticsExcel.vcxproj", "{E106958A-412F-4782-81CD-DF380D66BA6B}"
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,8 +13,8 @@ Global
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
                {E106958A-412F-4782-81CD-DF380D66BA6B}.Debug|Win32.ActiveCfg = Debug|Win32
                {E106958A-412F-4782-81CD-DF380D66BA6B}.Debug|Win32.Build.0 = Debug|Win32
-               {E106958A-412F-4782-81CD-DF380D66BA6B}.Release|Win32.ActiveCfg = Release|Win32
-               {E106958A-412F-4782-81CD-DF380D66BA6B}.Release|Win32.Build.0 = Release|Win32
+               {E106958A-412F-4782-81CD-DF380D66BA6B}.Release|Win32.ActiveCfg = Release|x64
+               {E106958A-412F-4782-81CD-DF380D66BA6B}.Release|Win32.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 77b34218353b8f90222eb5c0a8e22a2481e9bdb7..67c676b43c119ddd7808d13deb44f8a3a4e9eb15 100644 (file)
@@ -1,14 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{E106958A-412F-4782-81CD-DF380D66BA6B}</ProjectGuid>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v120</PlatformToolset>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v120</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v120</PlatformToolset>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v120</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+    <_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
+    <LinkIncremental>true</LinkIncremental>
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
+    <LinkIncremental>false</LinkIncremental>
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <GenerateManifest>false</GenerateManifest>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Midl>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <FloatingPointExceptions>true</FloatingPointExceptions>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
+      <PrecompiledHeader />
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <FloatingPointExceptions>true</FloatingPointExceptions>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <ShowProgress>LinkVerboseLib</ShowProgress>
+      <ModuleDefinitionFile>.\SimanticsExcel.def</ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>false</MkTypLibCompatible>
+    </Midl>
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader />
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <ModuleDefinitionFile>.\SimanticsExcel.def</ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Midl>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MkTypLibCompatible>false</MkTypLibCompatible>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="SimanticsExcel.cpp" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="SimanticsExcel.def" />
-    <None Include="res\SimanticsExcel.rc2" />
     <None Include="Debug\excel.tlh" />
     <None Include="Debug\mso.tlh" />
-    <None Include="ReadMe.txt" />
     <None Include="Debug\vbe6ext.tlh" />
+    <None Include="res\SimanticsExcel.rc2" />
+    <None Include="SimanticsExcel.def" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="jni2.h" />
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="targetver.h" />
   </ItemGroup>
+  <ItemGroup>
+    <Text Include="ReadMe.txt" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index d2c7715f0b663946f778523393daa5ffcdd40e3b..ba3eeec8b0751b8c3205a4e21961ab1150dbd7e4 100644 (file)
@@ -14,9 +14,8 @@ JNIEXPORT jint JNICALL Java_org_simantics_excel_Excel_setString(JNIEnv *env, job
 JNIEXPORT jint JNICALL Java_org_simantics_excel_Excel_setName(JNIEnv *env, jobject, jint handle, jint row, jint column, jstring value);
 JNIEXPORT jint JNICALL Java_org_simantics_excel_Excel_setVisible(JNIEnv *env, jobject, jint handle, jboolean value);
 JNIEXPORT jint JNICALL Java_org_simantics_excel_Excel_close(JNIEnv *env, jobject, jint handle);
-
-//JNIEXPORT jstring JNICALL Java_org_simantics_excel_Excel_getString(JNIEnv *env, jobject, jint handle, jint row, jint column);
-//JNIEXPORT jdouble JNICALL Java_org_simantics_excel_Excel_getDouble(JNIEnv *env, jobject, jint handle, jint row, jint column);
+JNIEXPORT jstring JNICALL Java_org_simantics_excel_Excel_getString(JNIEnv *env, jobject, jint handle, jint row, jint column);
+JNIEXPORT jdouble JNICALL Java_org_simantics_excel_Excel_getDouble(JNIEnv *env, jobject, jint handle, jint row, jint column);
 
 #ifdef __cplusplus
 }
diff --git a/bundles/org.simantics.excel/scl/Excel.scl b/bundles/org.simantics.excel/scl/Excel.scl
new file mode 100644 (file)
index 0000000..4314025
--- /dev/null
@@ -0,0 +1,19 @@
+importJava "org.simantics.excel.Excel" where
+
+  data Excel
+  
+  @JavaName "getInstance"
+  excelInstance :: () -> <Proc> Excel
+  
+  @JavaName "open2_"
+  openExcelSheet :: Excel -> String -> String -> <Proc> Integer
+  @JavaName "close_"
+  closeExcelSheet :: Excel -> Integer -> <Proc> ()
+  @JavaName "setString_"
+  setExcelString :: Excel -> Integer -> Integer -> Integer -> String -> <Proc> Integer
+  @JavaName "getString_"
+  getExcelString :: Excel -> Integer -> Integer -> Integer -> <Proc> String
+  @JavaName "setDouble_"
+  setExcelDouble :: Excel -> Integer -> Integer -> Integer -> Double -> <Proc> Integer
+  @JavaName "getDouble_"
+  getExcelDouble :: Excel -> Integer -> Integer -> Integer -> <Proc> Double
index bf7ddb5d5625966d05a13566db889c57f3a885e2..d692206bd147d1436ec17736f8082a80311c246c 100644 (file)
@@ -45,6 +45,10 @@ public class Excel {
 
     private static Excel instance;
 
+    public static Excel getInstance() throws ExcelException {
+        return getInstance(System.out);
+    }
+
     public static Excel getInstance(PrintStream out) throws ExcelException {
 
         if(instance == null) {
@@ -89,11 +93,11 @@ public class Excel {
 
         File extractDir = context.getDataFile("");
         if (extractDir == null)
-            throw new IOException("Bundle '" + Activator.PLUGIN_ID + " context has no file system support. Cannot extract server executables.");
+            throw new IOException("Bundle '" + Activator.PLUGIN_ID + " context has no file system support. Cannot extract DLLs.");
 
         if (!extractDir.exists())
             if (!extractDir.mkdir())
-                throw new IOException("Could not create directory '" + extractDir.getCanonicalPath() + "' for storing Balas solver data.");
+                throw new IOException("Could not create directory '" + extractDir.getCanonicalPath() + "' for communicating with Excel.");
         
         return extractDir;
         
@@ -266,7 +270,7 @@ public class Excel {
         
         if (!extractDir.exists())
             if (!extractDir.mkdir())
-                throw new IOException("Could not create directory '" + extractDir.getCanonicalPath() + "' for storing Balas solver data.");
+                throw new IOException("Could not create directory '" + extractDir.getCanonicalPath() + "' for communicating with Excel.");
 
         String asd = "";
         ExecEnvironment env = ExecEnvironment.calculate();
@@ -306,8 +310,8 @@ public class Excel {
     private native int setVisible(int handle, boolean value);
     private native int close(int handle);
     
-//    private native double getDouble(int handle, int row, int column);
-//    private native String getString(int handle, int row, int column);
+    private native double getDouble(int handle, int row, int column);
+    private native String getString(int handle, int row, int column);
 
     final ScheduledExecutorService  scheduler = Executors.newSingleThreadScheduledExecutor();
 
@@ -331,6 +335,20 @@ public class Excel {
        });
     }
 
+    public int open2_(final String fileName, final String sheetName) {
+        try {
+            return scheduler.submit(new Callable<Integer>() {
+                @Override
+                public Integer call() throws Exception {
+                    return Integer.parseInt(open(fileName, sheetName));
+                }
+            }).get();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return -1;
+        }
+    }
+
     public String open_(final String fileName, final String sheetName) {
         try {
             return scheduler.submit(new Callable<String>() {
@@ -437,32 +455,32 @@ public class Excel {
         }
     }
     
-//    public double getDouble_(final int handle, final int row, final int column) {
-//        try {
-//            return scheduler.submit(new Callable<Double>() {
-//                @Override
-//                public Double call() throws Exception {
-//                    return getDouble(handle, row, column);
-//                }
-//            }).get();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return Double.NaN;
-//        }
-//    }
-//    
-//    public String getString_(final int handle, final int row, final int column) {
-//        try {
-//            return scheduler.submit(new Callable<String>() {
-//                @Override
-//                public String call() throws Exception {
-//                    return getString(handle, row, column);
-//                }
-//            }).get();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return null;
-//        }
-//    }
+    public double getDouble_(final int handle, final int row, final int column) {
+        try {
+            return scheduler.submit(new Callable<Double>() {
+                @Override
+                public Double call() throws Exception {
+                    return getDouble(handle, row, column);
+                }
+            }).get();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Double.NaN;
+        }
+    }
+    
+    public String getString_(final int handle, final int row, final int column) {
+        try {
+            return scheduler.submit(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return getString(handle, row, column);
+                }
+            }).get();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
 
 }