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
22
votes
6 answers

How to call managed code from unmanaged code?

I want to call my .NET code from unmanaged C++. My process entrypoint is .NET based, so I don't have to worry about hosting the CLR. I know it can be done using COM wrappers for .NET objects, but I would like to access individual static methods of…
Hanan
  • 1,395
  • 4
  • 18
  • 29
22
votes
3 answers

Microsoft.Office.Interop.Excel.ApplicationClass has no constructor defined

I tried to follow How to open an Excel file in C# tutorial, i.e. added a reference on the Com tab to Microsoft Office 14.0 Object Library and tried to compile code: using Excel = Microsoft.Office.Interop.Excel; //... Excel.Application…
horgh
  • 17,918
  • 22
  • 68
  • 123
21
votes
4 answers

WPF TextBox not accepting Input when in ElementHost in Window Forms

We are developing a UI Control in WPF to be consumed within an existing Windows Forms / MFC application engine (Rhino 3D). The application engine exposes the ability create a "Dockbar" which essentially lets you put Windows Forms controls inside a…
Jason Stevenson
  • 4,004
  • 3
  • 29
  • 49
21
votes
6 answers

interoperation between mercurial and subversion

A similar question has been asked recently, but is not the same. The Mercurial website has a detailed page listing comparisons for 4 different options for getting Mercurial and Subversion to interoperate. I am wondering if anyone out there has tried…
Jason S
  • 184,598
  • 164
  • 608
  • 970
21
votes
4 answers

Is it possible to get/set the console font size?

I have seen posts on changing console true type font and console colors (rgb) but nothing on setting or getting the console font size. The reason I want to change the font size is because a grid is printed to the console, and the grid has many…
Chris
  • 2,340
  • 6
  • 40
  • 63
21
votes
1 answer

How do I handle null or optional DLL struct parameters

How do I deal with optional struct arguments in dll methods called from C# using pinvoke? For example, the lpSecurityAttributes parameter here should be passed null when absent. The correct way of passing struct's seems to be using ref, but it…
River
  • 8,585
  • 14
  • 54
  • 67
21
votes
2 answers

Automatically creating C# wrappers from c headers?

Is there a way to automatically create p/invoke wrappers for .net from a c header? Of course I could create them by hand, but maintaining them would be painful, and I'd probably make a mistake somewhere resulting in hard to debug crashes. I tried…
Winner
  • 253
  • 1
  • 2
  • 6
21
votes
13 answers

WinWord.exe won't quit after calling Word.Documents.Add - Word .NET Interop

I'm running into the classic scenario where, when creating Word COM objects in .NET (via the Microsoft.Office.Interop.Word assembly), the WinWord process won't exit even though I'm properly closing and releasing the objects. I've narrowed it down to…
Keith
  • 20,636
  • 11
  • 84
  • 125
21
votes
5 answers

Could not load file or assembly 'Microsoft.mshtml ... Strong name validation failed

I made a WPF/C# program and I am using the internet control for WYSIWYG HTML editing. it is a regular Executable program. it works on most computers however some computers are giving me the following error. Could not load file or assembly …
Rabbi
  • 4,622
  • 9
  • 35
  • 45
21
votes
7 answers

Python for .NET "unable to find assembly" error

I'm using CPython and I have a C# dll. I'm trying to use Python for .NET to make them talk. I can't use IronPython because I need to integrate this into an existing CPython system. I'm completely new to Python for .NET, and I actually have very…
Annie
  • 335
  • 1
  • 2
  • 6
20
votes
5 answers

Using F1 Help (CHM format) With WPF

I've been working on a WPF application for a while, and the time has come to attach the CHM format help document to it. But alas! HelpProvider, the standard way to show CHM files in Winforms, has magically vanished and has no counterpart in WPF.…
phyllis diller
  • 795
  • 2
  • 9
  • 21
20
votes
2 answers

C++/CLI delegate as function pointer (System.AccessViolationException)

I have been experimenting with C++/CLI delegates (as I am trying to make a .NET reference library), and I have been having the following problem. I define a delegate in C++/CLI, and then create an instance of the delegate in C#, and then call the…
xcvd
  • 563
  • 1
  • 7
  • 19
20
votes
2 answers

Set System Time Zone from .NET

Does anyone have some code that will take a TimeZoneInfo field from .NET and execute the interop code to set the system time zone via SetTimeZoneInformation? I realize that it's basically mapping the TimeZoneInfo members to the struct members, but…
user19297
  • 203
  • 1
  • 2
  • 4
20
votes
3 answers

C# Excel Interop: How to format cells to store values as text

I'm writing numbers to an Excel spreadsheet from a DataTable and all of these numbers are 5 digits long with preceding 0s if the number itself is less than 5 digits long (so 395 would be stored as 00395, for example). When entering these numbers…
Closeratio
  • 615
  • 2
  • 6
  • 13
20
votes
4 answers

Jython and python modules

I've just started using the PythonInterpreter from within my Java classes, and it works great! However, if I try to include python modules (re, HTMLParser, etc.), I'm receiving the following exception (for re): Exception in thread "main" Traceback…
Geo
  • 93,257
  • 117
  • 344
  • 520