interop

Erlang Universal Binary Format? Anyone using it?

 ̄綄美尐妖づ 提交于 2019-12-03 09:45:24
问题 I recently stumbled upon this 2002 conference paper ( Getting Erlang to talk to the outside world by Joe Armstrong) and I was wondering whether this is a standard that was ignored or if there was any adoption? Should I focus on Apache Thrift for inter-platform communication? (whatever solution I choose will involve at least Erlang) 回答1: You might find the following information helpful about UBF (i.e. UBF User's Guide). http://ubf.github.com/ubf/ubf-user-guide.en.html This might help answer

How to declare and implement a COM interface on C# that inherits from another COM interface?

送分小仙女□ 提交于 2019-12-03 08:52:51
I'm trying to understand what is the correct why to implement COM interfaces from C# code. It is straightforward when the interface doesn't inherit from other base interface. Like this one: [ComImport, Guid("2047E320-F2A9-11CE-AE65-08002B2E1262"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IShellFolderViewCB { long MessageSFVCB(uint uMsg, int wParam, int lParam); } However things start to become weired when I need to implement an interface that inherits from other COM interfaces. For example, if I implement the IPersistFolder2 interface which inherits from

C# - Hook into existing COM object

你说的曾经没有我的故事 提交于 2019-12-03 08:33:08
Say we have an existing process (or application) that calls a COM object from an ocx file such as "MyCOMLibrary.ocx". Is there a way to write a C# library to exactly replicate the ocx file? So that the original application can call your C# code rather than the original COM object? You would, of course, have to use identical CLSID and ProgIDs as the original ocx. And assuming there is no signing involved, such as a SNK in the .Net world. Also, are there any tools that exist to automate this? Something that takes in an ocx and spits out a C# file with methods to implement. EDIT: I want to add

Excel Interop Print

荒凉一梦 提交于 2019-12-03 08:28:44
I need to print a selected area of an excel sheet (which I selected with Range.Select()) using the following print settings: Printer: Microsoft XPS Document Writer Print Selection Landscape Orientation A4 Normal Margins Fit Sheet on One Page How can I achieve this using _Worksheet.PrintOut or _Worksheet.PrintOutEx? Thanks in advance! Siddharth Rout Try this ( TRIED AND TESTED ) I am assuming that you have set reference to Excel and have already declared your objects like Microsoft.Office.Interop.Excel.Application xlexcel; Microsoft.Office.Interop.Excel.Workbook xlWorkBook; Microsoft.Office

C# / IronPython Interop with shared C# Class Library

↘锁芯ラ 提交于 2019-12-03 07:52:54
问题 I'm trying to use IronPython as an intermediary between a C# GUI and some C# libraries, so that it can be scripted post compile time. I have a Class library DLL that is used by both the GUI and the python and is something along the lines of this: namespace MyLib { public class MyClass { public string Name { get; set; } public MyClass(string name) { this.Name = name; } } } The IronPython code is as follows: import clr clr.AddReferenceToFile(r"MyLib.dll") from MyLib import MyClass ReturnObject

OpenCL/OpenGL Interop with Multiple GPUs

白昼怎懂夜的黑 提交于 2019-12-03 07:33:58
问题 I'm having trouble using multiple GPUs with OpenCL/OpenGL interop. I'm trying to write an application which renders the result of an intensive computation. In the end it will run an optimization problem, and then, based on the result, render something to the screen. As a test case, I'm starting with the particle simulation example code from this course: http://web.engr.oregonstate.edu/~mjb/sig13/ The example code creates and OpenGL context, then creates a OpenCL context that shares the state,

Does COM interop respect .NET AppDomain boundaries for assembly loading?

拈花ヽ惹草 提交于 2019-12-03 07:03:11
Here's the core problem: I have a .NET application that is using COM interop in a separate AppDomain. The COM stuff seems to be loading assemblies back into the default domain, rather than the AppDomain from which the COM stuff is being called. What I want to know is: is this expected behaviour, or am I doing something wrong to cause these COM related assemblies to be loaded in the wrong AppDomain? Please see a more detailed description of the situation below... The application consists of 3 assemblies: - the main EXE, the entry point of the application. - common.dll, containing just an

Why does an 8-bit field have endianness?

痞子三分冷 提交于 2019-12-03 06:08:20
See the definition of TCP header in /netinet/tcp.h: struct tcphdr { u_int16_t th_sport; /* source port */ u_int16_t th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ # if __BYTE_ORDER == __LITTLE_ENDIAN u_int8_t th_x2:4; /* (unused) */ u_int8_t th_off:4; /* data offset */ # endif # if __BYTE_ORDER == __BIG_ENDIAN u_int8_t th_off:4; /* data offset */ u_int8_t th_x2:4; /* (unused) */ # endif u_int8_t th_flags; # define TH_FIN 0x01 # define TH_SYN 0x02 # define TH_RST 0x04 # define TH_PUSH 0x08 # define TH_ACK 0x10 # define TH_URG

Changing an Excel cell's backcolor using hex results in Excel displaying completely different color in the spreadsheet

↘锁芯ラ 提交于 2019-12-03 06:03:15
So I am setting an Excel cell's Interior Color to a certain value, like below: worksheet.Cells[1, 1].Interior.Color = 0xF1DCDB; However, when I then open up the spreadsheet in Excel, I see that the color that came out is completely different (in the above case, the color in the resulting spreadsheet is 0xDCDCEF). I tried a few different colors and it always changes it, and I don't see a pattern. Is there any reason for this? I even tried setting the color by writing Color.FromArgb(241, 220, 219).ToArgb(), and the same thing happened. I finally figured it out, after lots of tests, and it was

Conversion of Scala map containing Boolean to Java map containing java.lang.Boolean

女生的网名这么多〃 提交于 2019-12-03 05:58:30
I'd like to convert a scala map with a Boolean value to a java map with a java.lang.Boolean value (for interoperability). import scala.collection.JavaConversions._ val a = Map[Int, Boolean]( (1, true), (2, false) ) val b : java.util.Map[Int, java.lang.Boolean] = a fails with: error: type mismatch; found : scala.collection.immutable.Map[Int,scala.Boolean] required: java.util.Map[Int,java.lang.Boolean] val b : java.util.Map[Int, java.lang.Boolean] = a The JavaConversions implicit conversions work happily with containers parameterized on the same types, but don't know about the conversion between