Questions tagged [interop]

Interoperability is a requirement for one computer system or programming language to work with another.

Interoperability is a requirement for one computer system or programming language to work with another.

A number of computer systems, especially Microsoft's .NET Framework, reduce this term to Interop.

5732 questions
20
votes
7 answers

Interoperating between Matlab and C#

After peeking around the internet it looks like it is possible to interop between C# and Matlab. I am wondering if anyone has had success with it and what they did to do so. If possible somehow pulling it off without the use of COM. Thanks for your…
smaclell
  • 4,568
  • 7
  • 41
  • 49
20
votes
1 answer

Generate Swift Interface from Objective-C Header from Command Line

In Xcode, for any Objective-C header, we can view the Generated Interface, which shows how it is seen by Swift in interop. I'd like to generate that from the command line. Any idea how to do it? Bonus task: The header should be precompiled first, so…
fabb
  • 11,660
  • 13
  • 67
  • 111
20
votes
2 answers

What exactly is the GNU tar ././@LongLink "trick"?

I read that a tar entry type of 'L' (76) is used by gnu tar and gnu-compliant tar utilities to indicate that the next entry in the archive has a "long" name. In this case the header block with the entry type of 'L' usually encodes the name…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
20
votes
3 answers

make IntPtr in C#.NET point to string value

I am using a class which has StringHandle field which is an IntPtr value that represents a LPCWSTR in C++. internal IntPtr StringHandle; // LPCWSTR say now that I have a String: string x = "abcdefg" How can I use the String handle to point to the…
Saher Ahwal
  • 9,015
  • 32
  • 84
  • 152
19
votes
4 answers

Registering COM referenced DLLs on a build server

We're developing a C# application that references a few COM libraries (AutoIT for example). I am including all referenced components under source control, in a 3rd party "Libs" folder. The problem is that COM dll's don't have a HintPath property in…
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
19
votes
3 answers

How to Make Compiler Assume `nullable` by Default

Since Xcode 6.3, types in Objective-C can be marked with nullable or nonnull, here is Apple's blog post about this. Problem is, when neither is specified, then the compiler imports the Objective-C code as implicitly unwrapped into Swift, e.g.…
fabb
  • 11,660
  • 13
  • 67
  • 111
19
votes
2 answers

HwndHost for Windows Form - Win32 / WinForm Interoperability

I need to host a Win32 window in a Windows Form control. I had the same problem with WPF and I solved this problem by using the HwndHost control. I followed this tutorial: Walkthrough: Hosting a Win32 Control in WPF Is there any equivalent control…
Nick
  • 10,309
  • 21
  • 97
  • 201
18
votes
2 answers

Why is the handling of exceptions from CloseHandle different between .NET 4 and 3.5?

I'm encountering a situation where a PInvoke call to CloseHandle is throwing an SEHException in a .NET 4 application when run under a debugger. Unlike others who have encountered similar issues migrating from 3.5 to 4, I'm not particularly bothered…
jeffora
  • 4,009
  • 2
  • 25
  • 38
18
votes
1 answer

C++/CLI Resource Management Confusion

I am extremely confused about resource management in C++/CLI. I thought I had a handle (no pun intended) on it, but I stumbled across the auto_gcroot class while looking through header files, which led to a google search, then the better part of…
Max Ehrlich
  • 2,479
  • 1
  • 32
  • 44
18
votes
4 answers

No definition found for GetActiveObject from System.Runtime.InteropServices.Marshal C#

I'm trying to connect to a running Excel instance, but when I try to use the following code snippet: using Microsoft.Office.Interop.Excel; using System.Runtime.InteropServices; public Application StartExcel() { Application instance = null; …
Patrick.H
  • 535
  • 3
  • 6
  • 21
18
votes
1 answer

System.Type.Missing or System.Reflection.Missing.Value when working with Office PIA?

I searched these SO results and couldn't find anything related to my question. I doubt this could be a duplicate. I'm currently writing a Microsoft.Office.Interop.Excel PIA wrapper in .NET C# 3.5 and was wondering about what is best to use while…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
18
votes
6 answers

Visual Studio 2010, TlbImp generates .net 4.0 interops in 2.0 projects

In a C# project we add a reference to a COM object via the Add References setup pointing to a COM object which results in the IDE auto-generating the interop assembly. So this is fine and good, but we are building based on .net 3.5 SP1 aka CLR 2.0,…
DJScrib
  • 305
  • 1
  • 3
  • 7
18
votes
3 answers

Which blocking operations cause an STA thread to pump COM messages?

When a COM object is instantiated on an STA thread, the thread usually has to implement a message pump in order to marshal calls to and fro other threads (see here). One can either pump messages manually, or rely on the fact that some, but not all,…
bavaza
  • 10,319
  • 10
  • 64
  • 103
18
votes
1 answer

CUDA/OpenGL interop, draw to OpenGL texture with CUDA

I am writing a rendering system in CUDA and want results to be quickly displayed via OpenGL, without touching main memory. I basically do the following: Create and initialize OpenGL texture, and register it in CUDA as cudaGraphicsResource GLuint…
yuri kilochek
  • 12,709
  • 2
  • 32
  • 59
18
votes
8 answers

Excel Interop - Draw All Borders in a Range

I see from Microsoft's documentation that I can access the particular border edges of a cell using the 'xlBordersIndex' property and for example set the border style for the left edge of a…
spickles
  • 635
  • 1
  • 12
  • 21