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
3 answers

Writing C++ intended to be called from C#?

So I am doing this as a learning moment and I'm not afraid to say I have no idea what I'm doing here. It might also be worth mentioning that I don't know much about C++ in this scenario. In C#, I've used DllImport plenty of times to bring in stuff…
Corey Ogburn
  • 21,622
  • 25
  • 107
  • 169
2
votes
2 answers

Find the MS Word Table that contain a specific text

I have a MS Word document look like this Now I want to find which table contains the phrase "/CCID_ntRow/". As you can see from the document structure, it's the second table. But every table I loop through, the return of Find.Execute returns…
Hoang Lam
  • 326
  • 1
  • 6
  • 23
2
votes
3 answers

What are the troubleshooting steps/tools for C# to Native interop?

I have an SDK that is written primarily in C#. We have some native code that was written for security and performance reasons. We use DllImport to interop with the native code. There are a few functions that I get an "Unable to find an entry…
Pat O
  • 1,294
  • 2
  • 12
  • 27
2
votes
1 answer

COMException Breakdown

Does anyone know if a site (even non-Microsoft), that has details on COMExceptions/HRESULTS. When I attempted to Save my Excel Workbook after using the Copy() function, I received this error: ERROR - Unable to…
Chris
  • 6,398
  • 8
  • 42
  • 58
2
votes
4 answers

What are my options for C++ DLL to call a C# DLL?

I have a C++ DLL that needs to call a function (pass a value, return a value) in a C# class library. Is my only option to give the C# DLL a COM interface and call it from C++ with IDispatch? Is this the best method?
Jason
  • 16,287
  • 23
  • 84
  • 136
2
votes
3 answers

How do I get the ProgID of a COM component from C#?

I have an application that is written in C# I want to display a list of COM components in a folder on the system with details about the component, initially the ProgID. Is there a way of interrogating a component from my C# code to find out the…
Alan
2
votes
0 answers

Excel 2010 interop defining in-line XML Styles

In .net you can create excel sheets programmatically. You can define a style like this: And assign that style to a cell.
Houman
  • 58,044
  • 75
  • 235
  • 407
2
votes
3 answers

Read data from Excel files

I'm having some trouble reading from an Excel spreadsheet in C#. I have this code which I read every cell from A to X. System.Array myvalues; string[] strArray; Microsoft.Office.Interop.Excel.Range range = worksheet.get_Range("A" +…
Vlasin
  • 198
  • 2
  • 3
  • 12
2
votes
1 answer

Get hWnd for XAML control in Windows 8 (Metro) app?

I need to pass a hwnd to a native dll that is going to write raw video to the frame. In WPF this works because you can get a hwnd reference from a control. Is this possible in a Metro app?
Kellen
  • 591
  • 1
  • 3
  • 14
2
votes
1 answer

wcf Interop: No timestamp is available in security header to do replay detection

I am trying to call a Java service using WCF. The service sends a message back but it does not make back to my program. WCF generates: No Timestamp is available in security header to do replay detection. I captured the returned message in Fiddler…
KeithMacCrimmon
  • 180
  • 2
  • 12
2
votes
1 answer

In which cases should parameters be pinned when performing a P/Invoke call

I have a DLL from which I need to P/Invoke the following C method: int DAOpen(HANDLE *hOpen, UNIT *flags, void *callback, char *userData) I've come up with the following C# signature: [DllImportAttribute("", EntryPoint="DAOpen")] …
XenoAce
  • 79
  • 6
2
votes
1 answer

How to build a 64-bit .NET DLL, with 64-bit COM interop?

I need to build a managed DLL, targeted for x64, and expose it via x64 COM. I need a walk through, good article, etc... Interop is fairly straightforward, but when you talk about x64 on both sides, I can't find anything.
Jason
  • 16,287
  • 23
  • 84
  • 136
2
votes
2 answers

In VB6, how do I call a COM object requiring a pointer to an object?

I'm having trouble with a .NET Assembly that is com visible, and calling certain methods from VB6. What I have found is that if the parameters are well defined types, (e.g. string), calls work fine. If they are higher level objects, it raises a…
dermdaly
  • 509
  • 4
  • 14
2
votes
2 answers

Is it possible to return a LPWSTR from C++ DLL to C# app

The C++ function definition is this __declspec(dllexport) LPWSTR __stdcall GetErrorString(int errCode); And I call it in C# like this [DllImport("DLLTest.dll")] public static extern string GetErrorString(int errCode); static void Main(string[]…
Bill Walton
  • 805
  • 1
  • 15
  • 31
2
votes
1 answer

From C++ wchar_t to C# char via socket

I am currently building a C++ application that communicate via socket to a C# application. My C++ app sends wchar_t* via socket. Here is an overview of what is send :