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.

5522 questions
2
votes
2 answers

.NET 4 vs .NET 3.5 C# application. Could not load file or assembly 'x' or one of its dependencies. The specified module could not be found

I have a C# WPF application built in VS 2010 with Target Platform set to x86. This exe calls on a Managed DLL with target platform ANYCPU. The Managed DLL has a reference to a C++ DLL which is compiled with Common Language Runtime Support (/clr)…
Kam B
  • 21
  • 3
2
votes
4 answers

Call a C# method/function from a C++ DLL (which is loaded from C# with "Dllimport")

It's a little hard to resume it in a single title, so here my situation. I'm building a C# application that loads a C++ library. I call functions from that C++ DLL. But I'd also like my C++ DLL to call functions from the C# application (that is…
Jsncrdnl
  • 2,725
  • 5
  • 24
  • 43
2
votes
1 answer

Calling C# method from unmanaged C++ which passes back a full object model

I have something similar to the following in C#: public class ClassA { int Id { get; set; } ClassB[] ClassBItems { get; set; } } and public class ClassB { int SomeOtherId {get;set;} } I want…
ahallan
  • 69
  • 6
2
votes
1 answer

What (if there are any) are the (free) alternatives to COM interop with MS Excel using .NET?

Background: I'm trying to make a decision on whether to go down the road of automating Excel using C# via Interop. I'm certainly not a VBA guy and for numerous reasons, I'd prefer not to go down that road. I don't know much about other options,…
PatternMatching
  • 426
  • 2
  • 13
2
votes
1 answer

When is pinning required to avoid C# garbage collector moving an object?

When is pinning using the fixed() statement required? I see many examples, including this from Microsoft: public class Win32API { [DllImport("User32.Dll")] public static extern void GetWindowText(int h, StringBuilder s, int nMaxCount); } public…
Mike
  • 1,236
  • 4
  • 16
  • 26
2
votes
1 answer

How to perform late-bound invocation (via DispID) of COM object defined in .NET from .NET?

I want to invoke a method on a COM object that is defined in .NET from another .NET application using the DispID. I have the following class and interface defined in a .NET project: using System; using System.Collections.Generic; using…
DeCaf
  • 5,731
  • 1
  • 25
  • 44
2
votes
2 answers

Management of Static Global Unmanaged Resources in Multithreaded App

We've run into a resource management problem that we've been struggling with for several weeks now and while we finally have a solution, it still seems weird to me. We have a significant amount of interop code we've developed against a legacy…
Jeff
  • 2,491
  • 2
  • 20
  • 35
2
votes
2 answers

ISO_C_BINDING between different Fortran and C vendors

Is the concept of the Fortran ISO_C_BINDING module also supported by C/C++ compiler vendors? For example, the size of a C/C++ int can vary between the compilers from different vendors. So, with the ISO_C_BINDING module, we know that a Fortran C_INT…
user2023370
  • 9,597
  • 5
  • 41
  • 74
2
votes
1 answer

How to compile a C++/CLI program into .lib and link it with a pure unmanaged C++ program?

I'm following this http://www.codeproject.com/Articles/10020/Using-managed-code-in-an-unmanaged-application The example consist of 3 binaries: C# code C++/CLI code C++ code The C++ code calls on the C++/CLI code, which then calls on the C# code,…
user25101622
  • 193
  • 1
  • 13
2
votes
2 answers

Threads shutdown during mixed managed/unmanaged c++/CLI process shutdown

I'm working on a mixed managed/native application using c++/CLI. I know that the CLR will suspend all managed threads on (a clean) shutdown, but what about the unmanaged ones? Is it possible for the unmanaged threads to still be running, while the…
Hrvoje Prgeša
  • 2,021
  • 5
  • 21
  • 36
2
votes
0 answers

publishing excel interop on the server does not work

Working locally is fine with this: Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Application excel = null; Workbook wb = null; excel = new Application(); excel.Visible = false; excel.DisplayAlerts = false; …
olidev
  • 17,514
  • 49
  • 124
  • 187
2
votes
1 answer

install Office Interops without Office on the server

I am working with changing excel cells using Excel Interop. I have tried with many open source solutions but the file is corrupted while reading. Therefore, I am stick on using Excel Interop. When developing on the server, I got this problem: Could…
olidev
  • 17,514
  • 49
  • 124
  • 187
2
votes
1 answer

Does .net interop do cross-thread marshalling for COM or do I need to use CoMarshalInterThreadInterfaceInStream or similar?

Can anyone give me a definitive answer as to whether I need to use something like CoMarshalInterThreadInterfaceInStream, CoGetInterfaceAndReleaseStream or GlobalInterfaceTable to marshall a COM interface between threads? In this thread some say…
Rory
  • 36,412
  • 47
  • 153
  • 230
2
votes
0 answers

Extract method signature from arbitrary dll

I'd like to create a testharness app for COM dlls. In psuedocode: Examine target DLL and determine public object(s) methods Let the user pick an object, method and parameters instantiate the object and call the method with the appropriate params I…
Basic
  • 25,223
  • 23
  • 108
  • 188
2
votes
1 answer

Marshaling arrays from VB.NET to COM object

I have a VB6 program which calls a COM method, passing 2 arrays as parameters and expecting 2 arrays to be populated in response. The code is this, where ItemIDs and ItemClientHandles are the input array parameters and MyItemServerHandles and Errors…
Enrico Detoma
  • 3,020
  • 2
  • 34
  • 49
1 2 3
99
100