Calling a C# library from python

It is actually pretty easy. Just use NuGet to add the “UnmanagedExports” package to your .Net project. See https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports for details. You can then export directly, without having to do a COM layer. Here is the sample C# code: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using RGiesecke.DllExport; class Test … Read more

What is the interop dll?

When you write code in VB6, the compiled result is a COM component. COM components provide interfaces, coclasses, structs and enums, which are normally described using a COM type library. However, to consume that COM component in .NET, you need type description in a format that .NET understands – that is, a .NET assembly (since … Read more

Excel Interop – Efficiency and performance

When using C# or VB.Net to either get or set a range, figure out what the total size of the range is, and then get one large 2 dimensional object array… //get values object[,] objectArray = shtName.get_Range(“A1:Z100”).Value2; iFace = Convert.ToInt32(objectArray[1,1]); //set values object[,] objectArray = new object[3,1] {{“A”}{“B”}{“C”}}; rngName.Value2 = objectArray; Note that its important … Read more

Using Kotlin class in Java: Cannot find symbol

Your Maven configuration adds the Kotlin compiler plugin, but doesn’t adjust the Java compiler plugin execution so that the Java compiler runs after the Kotlin compiler. Therefore, the Java compiler runs before Kotlin, and doesn’t see Kotlin-compiled classes. Here’s a snippet showing the correct configuration for a mixed-language project (taken from the documentation): <build> <plugins> … Read more

Git as mercurial client? Why no git-hg?

I haven’t tried this, but there seems to be a git-hg project. The project describes itself on the page and the README as: A git-hg utility for checking out and tracking a mercurial repo. A set of scripts for checking out and tracking a mercrial [sic] project. It doesn’t seem to work bi-directionally though (see … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)