interop

Avoid loading .Net Dlls in a C++/CLI project?

I have a project written in C++/CLI. Some of the types there are in managed code, and some are in completely native code. Let's say I have the produced DLL on a machine that dosen't have any version of the .Net framework installed, is there a way that another, native application will link with my "mixed-mode" Dll and use only the native ...

C# write to Excel using Linq

Hi, I'm writing an app where i need to retrieve some rows from a DB and dump them into an excel spreadsheet. I'm using Linq to retrieve these rows. is it possible to dump these rows directly into their couterparts in the excel sheet... (where one cell of excel corresponds to one cell of the DB) Thanks, RP ...

Absolute COM Confusion - C# interop with early-binding

I've been battling with VStudio, Google and various other tools and websites all day and found no solution - HELP!! I have two COM interfaces (pure COM, no ATL): IMyClassFactory and IMyClass with corresponding implementations I want to use them from C# BUT without registering the COM server with regsvr32. I expose the Class Factory wi...

Insert OLE object into WPF canvas?

Hi Folks! I'm getting stuck to a problem now for quite a long time. I want to use MathType (www.dessci.com) for my own application. Thats why i have to insert an ole object into a System.Windows.Controls.Canvas derived control. I searched the internet for quite a long time, not with real success. I found out that I probably have to use o...

How to Pass an Array from C# (VSTO) project to VBA Macro

I'm having performance issues with my VSTO solution, I believe the reason is mainly the way the cellColor is set cell by cell. This depends on data from a recordSet and is thus different everytime. (I can't use a copyFormats from another row/column) it's similar to filling a Range of values, only for that one there are several methods....

.NET CF, Interop & GPS_DEVICE structure

I am trying to use the GPS_DEVICE structure from within .NET CF 3.5 and I keep getting an error (87) returned from the call to GPSGetDeviceState. As far as I know, 87 means invalid parameter, but I do not know which parameter is invalid! Can anybody please advise to what I have done wrong with my code as I have now spent the best part o...

Fast (in means of developer time) way to use a lot of C++ code from Java

Background: We are designing a physics app, that will do a lot of data analysis, but our focus is integrating physical electronic equipement. Basically I would like to be able to call root (it's a big data analysis library from CERN written in C++) library written in C++ library from Java. Basically ability to use ROOT classes from Ja...

How to make C++ code draw on Java components

We are designing physics app, and we would like to have it written in Java, and also we want to use root (root is writen in C++). Root has some nice graphical features -- it is able to draw very nice 3D charts, and I'm thinking whether it's possible to embedd those charts in Java app. Is there any way to make C++ code draw on for examp...

How to marshal .NET string to variant for COM call

I'm using a third-party COM library from C#. There are get/set methods that take a parameter of type VARIANT (type VT_BSTR). In the .NET wrapper, these parameters appear as type object, i.e. object getValue(); void setValue( object val ); The getValue method works ok, I perform a simple cast of the object to type string: string str ...

.NET 3.5 ActiveX dll InteropServices.COMException

Using vs2008 .NET 3.5 SP1 I am trying to use an ActiveX dll in my c# console application project and I am getting this runtime exception: System.Runtime.InteropServices.COMException (0x800702E4): Retrieving the COM class factory for component with CLSID {4E58088E-7275-4EAA-8958-A9CCC971DDE9} failed due to the following error: 800702e4....

Writing a float value to unmanaged memory?

I'm building a .NET client and I referenced a RCW supplied by OPC Foundation. One of the functions has this parameter: [IN] IntPtr pPercentDeadBand The documentation mention that I should pass a pointer to a float value. This is where I struggle. I found Marshall..WriteByte, .WriteInt16 and .Writeint32. But nothing to write a float...

Log4net .Does it work in vb6 Interop to .net?

Hi I have some legacy application in vb6 and I am interoping into .net It all works fine in net alone but in vb6 it does not create the log. I cannot see what I am doing wrong. I have using log4net using config file and I have added the log4net configsection into C:\Program Files\Microsoft Visual Studio\vb6.exe.config has anybody got ...

Handling a SAFEARRAY returned from C# server.

Hi, I need to return an array of structure (classes) from a C# library to an unmanaged C++ client. This is the function in the C# library: [ComVisible(true)] [Serializable] public sealed class RetrieverProxy : IRetrieverProxy { public IMyRecord[] RetrieveMyRecords(long[] ids) { IList<IMyRecord> result = new List<IMyReco...

How to add SAN storage support to your application?

I want to add San Storage support in my application. Is there a standard protocol that I can use to communicate with all san storage devices like EMC Centera, Hitachi, NetApp or do I have to use library specific to each vendor? In a nutshell i'd like to save data on device and read it back. I know these devices can be mounted as drives ...

.NET and Lotus Notes Interop.

I've Lotus Notes database file (.nsf) at some location, let's say: http://intranet.mycompany.com/somewhere/data.nsf Is it possible in any way to read from that location using any .NET language? ...

Formatting Excel cell with Microsoft Interop

Hello, I generate some Excel file with Microsoft Interop, no problem, I can create files, sheet, file, password protect. But I'd like : for a specific range allow only numbers for an another specific range allow only numbers but only 0 or 1 Do you have an idea how to do this ? Thanks, ...

C# - Hook into existing COM object

Say we have an existing process (or application) that calls a COM object from an ocx file such as "MyCOMLibrary.ocx". Is there a way to write a C# library to exactly replicate the ocx file? So that the original application can call your C# code rather than the original COM object? You would, of course, have to use identical CLSID and ...

How Should an OS X Drawing Programs Store Custom Data in its PDF PasteBoard Flavor?

A little history. In the days when the pre-eminent Mac vectored clipboard flavor was PICT, a program could insert its own data into the PICT. The PICT could be pasted into another application. At some later date, the same drawing could be selected and put on the clipboard, and pasted back into the originating program. The originating pro...

COM object that has been separated from its underlying RCW cannot be used.

hi, I am trying to use the OpcRcw.da.dll; If I interop this dll inside a test console project everything works. But if I build dll project to do my interop gymnastic and ref my library into my console project I am getting this error. COM object that has been separated from its underlying RCW cannot be used. What need to be done...

Handling a VB6 event in C# - why does it only work sometimes?

I have a VB6 application implemented as an ActiveX exe. I also have a C# application that interacts with the VB6 app via COM. This all works fine except in one scenario. If the VB6 app is kicked off from the C# app, everything is fine. If, however, the VB6 app is already running stand-alone, then although the COM interface still works...