interop

Accessing static inner class defined in Java, through derived class

感情迁移 提交于 2019-12-01 17:00:47
I've got some classes defined in java, similar to the code below. I'm trying to access SomeValue through a derived java class, which is allowed in java, but not in kotlin. Is there a way to access the field through the derived class? // java file // ------------------------------------------------- class MyBaseClass { public static final class MyInnerClass { public static int SomeValue = 42; } } final class MyDerivedClass extends MyBaseClass { } // kotlin file // ------------------------------------------------- val baseAccess = MyBaseClass.MyInnerClass.SomeValue; // this compiles val

Gridlines in excel through interop

允我心安 提交于 2019-12-01 16:54:57
问题 Any idea where the setting is hiding for turning gridlines off while using excel 2003 from interop? 回答1: DisplayGridlines is a method on an Excel Window object. For example: ActiveWindow.DisplayGridlines = true 回答2: using Excel = Microsoft.Office.Interop.Excel; Excel.Application oXL; oXL.Windows.get_Item(1).DisplayGridlines = false; 回答3: oXL.Windows.Application.ActiveWindow.DisplayGridlines = false; write the code just before save excel code line. 回答4: Currently, using VS2012 and I did it as

What architecture to use to address this SystemOutOfMemoryException while allowing me to instantiate the cells of a sheet?

你。 提交于 2019-12-01 16:53:56
Summary This question is the follow-up of a a desire to architect a simple spreadsheet API while keeping it user-friendly to those who know Excel well. To sum it up, this question is related to these below two: 1. How to implement column self-naming from its index? ; 2. How to make this custom worksheet initialization faster? . Objective To provide a simplified Excel API used as a wrapper over the nevralgic components such as the Application , the Workbook , the Worksheet and the Range classes/interfaces while exposing only the most commonly used object properties for each of these. Usage

Access Java fields dynamically in Clojure?

我的梦境 提交于 2019-12-01 16:47:12
I'm a novice in clojure and java. In order to access a Java field in Clojure you can do: Classname/staticField which is just the same as (. Classname staticField) (correct me if I'm wrong) How can I access a static field when the name of the field in held within a variable? i.e.: (let [key-stroke 'VK_L key-event KeyEvent/key-stroke]) I want key-stroke to be evaluated into the symbol VK_L before it tries to access the field. In this case you might want to do something like the following: user=> (def m 'parseInt) #'user/m user=> `(. Integer ~m "10") (. java.lang.Integer parseInt "10") user=>

When should I explicitly specify a StructLayout?

南楼画角 提交于 2019-12-01 16:38:08
问题 I'm fiddling with calling DLLs from C#, and came across the need to define my own structs. Lots of articles force a sequential layout for the struct with [StructLayout(LayoutKind.Sequential)] struct Foo ... So, I followed suite, and my programme worked. Now, when I took the line out, it still works. Why do I need it? 回答1: The internal layout of a managed struct is undocumented and undiscoverable. Implementation details like member order and packing are intentionally hidden. With the

What do user-defined value classes look like from Java?

半腔热情 提交于 2019-12-01 16:03:57
I think I understand the new "value class" feature of Scala 2.10, by comparison with Haskell's newtype : trait BoundedValue[+This] extends Any { this: This => def upperBound: This def lowerBound: This } class Probability @throws(classOf[IllegalArgumentException]) (v: Double) extends AnyVal with BoundedValue[Probability] { val value: Double = if ((v >= 0.0) && (v <= 1.0)) v else throw new IllegalArgumentException((v.toString) + "is not within the range [0.0, 1.0]") override val upperBound: Probability = new Probability(0.0) override val lowerBound: Probability = new Probability(1.0) //

Calling vb6 dlls from c#

依然范特西╮ 提交于 2019-12-01 16:03:56
问题 I have been trying to call a vb6 dll from a C sharp application, without using the registry. I want to use the path of the dll while using it. I am unable to create an object of the class of the vb dll. Please help! The code I have written so far is as follows: Assembly assem = Assembly.LoadFile("dll path"); Type classType = assem.GetType("classname"); MethodInfo method = classType.GetMethod("show"); //My methos is called show method.Invoke(null,null); // I have to invoke the method using

System.Data.SQLite from NuGet, interop dll not copied to output directory

风流意气都作罢 提交于 2019-12-01 15:47:41
I installed System.Data.SQLite Core (x86/x64) from NuGet . It built without warnings but threw System.DllNotFoundException regarding SQLite.Interop.dll . I rigged my projects to copy the SQLite.Interop.dll from under the NuGet package's directory to the output directory, and now it runs without the exception. Why didn't the NuGet package configure my projects to put the appropriate interop dll in the output directory? It seems like it should be able to do that. I'm new to interop and I inherited this codebase, which previously referenced System.Data.SQLite.dll directly by path. I switched to

What architecture to use to address this SystemOutOfMemoryException while allowing me to instantiate the cells of a sheet?

一笑奈何 提交于 2019-12-01 15:35:44
问题 Summary This question is the follow-up of a a desire to architect a simple spreadsheet API while keeping it user-friendly to those who know Excel well. To sum it up, this question is related to these below two: 1. How to implement column self-naming from its index?; 2. How to make this custom worksheet initialization faster?. Objective To provide a simplified Excel API used as a wrapper over the nevralgic components such as the Application , the Workbook , the Worksheet and the Range classes

I can't get SetSystemTime to work in Windows Vista using C# with Interop (P/Invoke)

青春壹個敷衍的年華 提交于 2019-12-01 15:11:05
I'm having a hard time getting SetSystemTime working in my C# code. SetSystemtime is a kernel32.dll function. I'm using P/invoke (interop) to call it. SetSystemtime returns false and the error is "Invalid Parameter". I've posted the code below. I stress that GetSystemTime works just fine. I've tested this on Vista and Windows 7. Based on some newsgroup postings I've seen I have turned off UAC. No difference. I have done some searching for this problem. I found this link: http://groups.google.com.tw/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/805fa8603b00c267 where the