interop

What should I know when developing interoperable WCF web service?

I'm starting this Wiki to collect best practices about creating interoperable web services (not clients) in WCF. Please share your experience if you know any feature which is not generally interoperable or which is not interoperable with specific platform. ...

COM VB.NET works well but C# need recompile

I have a simple C# class with COM attributes: [ComClass("1DC7B465-49FA-4ad1-893E-C19657E1ED25", "F97459E6-AB37-43e6-AC57-6AE5F9A9A835", "BD9F01C7-162A-4f95-9398-C126C152B965")] [ComVisible(true)] public class Class1 { } I need to use this class from VB6 application. It works well until I change AssemblyVersion of .NET...

Automating Com DLL interop version.

So when visual studio build the interop dll it gets 4.0.0.0. The TypeLib version is 4.0 But the actuall DLL version is 4.0.1.112 Is there anyway I can get visual studio to automatically build the interop DLL to assume the actuall DLL version? Could I alternatively get the interop DLL to use the version stamp from my app. I just need...

creating a library in a single language with interfaces to everything else

Our business currently revolves around the development of a library, which can be used in a wide spectrum of industries (desktop, mobile, web and embedded). At the moment we only have customers within the desktop and web world and we already see that we are basically having to duplicate our code across multiple languages (c#, java and c+...

Marshal.ReleaseComObject throws exception

Trying to use a COM visible .NET class via other .NET application and get exception: Message: The object's type must be __ComObject or derived from __ComObject. Parameter name: o Stack Trace: at System.Runtime.InteropServices.Marshal.ReleaseComObject(Object o) The class looks as follows: [ComVisible(true)] [Inte...

How do I get HRESULT returns from libraries imported to c# with tlbimp.exe?

I am using the GMFBridge directshow filter from c# and the import library seems to discard the HRESULTs. i.e [id(5), helpstring("Create render filters in empty render graph")] HRESULT CreateRenderGraph( [in] IUnknown* pSourceGraphSinkFilter, [in] IUnknown* pRenderGraph, [out, retval] IUnknown** pRenderGraphSourceFilter); [id(6), ...

Graph.Chart interop in Word

I'm having massive problems when trying to update a chart through MSWord interop. All I want to do is set the values on a chart in a word document so the graph can update to values in my app. I've done the following (after importing Microsoft.Office.Interop.Graph.dll): InlineShape chartShape = WordDocument.InlineShapes[...

IntPtr To String conversion in Windows messages

I'm getting in trouble by hooking window messages. I need to detect window text (caption) changes, so I intercept the WM_SETTEXT message for the interesting windows (I do so because at window creation the window caption is not specified). Reading the documentation of the WM_SETTEXT documentation, the lParam parameter specify a pointer t...

How can I call my C# code from a C++ dll? Access violation problem.

Background: Big C++ MFC app that's not going to get rewritten any time soon. Few years ago needed to add features and decided that it would be easier built with C# and .NET so needed a way to call into .NET functions with the C++ app. At the time we were using VC6.0 for the MFC app and we built the .NET functionality using VS.NET 2...

Where can I find MS ActiveX Data Object (ADOR) Primary Interop Assembly (PIA)?

I'm trying to generate a Primary Interop Assembly for one of my projects that references Microsoft ActiveX Data Objects (MDAC 2.8). Adding this library through the References dialog box in Visual Studio adds the Interop.ADOR.dll file to the bin directory of the solution. However, when I run tlbimp.exe I get the error: C:\Solution> tlbi...

Passing a VBA Collection of String Arrays (Variants) as a List of String[] Arrays to a C# COM interop object?

I have a C# COM interop object that accepts a List of String[] arrays. Trying to pass something that somewhat resembles a List of String[] Arrays to be passed from my VBA Access 2000 application, to my C# COM object. I already have the object written out and I'm a little frustrated because I know little about VBA. Thank you in advanced! ...

How to open a file when file handle number is known?

I open a file in C# with FileStream, and I got the file handle number with this line: IntPtr file_handle = fs.SafeFileHandle.DangerousGetHandle(); Now I want to pass this handle to C++ code and use this handle value to access the file. Is this possible? How to open a file with merely a file handle in C++? Thanks. Update I use C# to...

Run WPF Application from a Windows Form

I have a problem with a solution that I'm trying to develope. This is my scenario: I have a VB6 application and I would call from this application some WPF windows. I've used the Interop Form Library to define a WinForm like a bridge from VB6 to WPF. The Interop WinForm exposes the methods to start and shutdown the wpf application. To d...

How to use different credentials with several COM objects (via RCW) in .NET

My understanding is that as soon as .NET fires up the RCW to access a COM object, the security credentials are persisted within the COM context until the .NET application is closed... thereby preventing the use of different credentials later on during execution. There is a RCW wrapper on Codeplex that I think will allow me to take a giv...

How can I create a jar from some Scala source code?

How can I create a jar from some Scala source code? I want to use some of that code in a Clojure project of mine. Is there a simpler way than doing batch files as in this SO question? Thanks, Alex ...

How to properly hide methods and properties from intellisense

Hi, Would anyone know how to properly hide classes, methods and properties from intellisense while preserving the ability to call them; and so they do not appear in interop assemblies that are generated from a type library? I'm writing API hooks for automated testing we don't want exposed to consumers yet. This appears to work well from...

Using scala to call java.util.Hashtable#put

I've an unexpected trouble calling put on an old-school hashtable. What's going on here? Welcome to Scala version 2.8.0.final (Java HotSpot(TM) Client VM, Java 1.6.0_21). Type in expressions to have them evaluated. Type :help for more information. scala> import com.ibm.mq._ import com.ibm.mq._ scala> MQEnvironment.pro...

How do I detect in C# whether or not a Word instance has the Save as PDF or XPS add-in?

I am using Visual Studio 2010 with Visual Studio Tools for Office installed. I will be interfacing with Word through its PIA. My target Word version is at least 2003. Muhimbi has informed me that Save as PDF isn't available in 2003 so what I would like to do is check if it's available in the version installed (2003 and later) and then...

Version of Outlook Redemption

What version of Redemption should i use if i have: Windows 7 x64, WinForms App (x64), Outlook 2010 x86. The problem is that Redemption64 5.0 does not work in this case. ...

Is true SOAP interoperability a myth?

I mean, true true interop: from Java to .NET, from PHP to Java, etc. I'm asking because our powers that be want us to implement public-facing API with SOAP web services, and I'm trying to make a strong point in favor of RESTful XML/JSON API. Their reasoning is very much brainwashing-induced: SOAP is a standards-based protocol (let a...