interop

Clarification on how to properly declare interop interfaces

This is just a question on how to write my code for a COM import. My understanding of the correct implementation of interop interfaces is that the main criteria is that: All method signatures must match in a compatible way Methods must appear in exactly the same order in the .Net interface as they do in the unmanaged interface When th...

PowerPoint Printing Problem c# - Nothing gets printed.

Guys, i am trying to print powerpoint docs through my windows application in c#. I am using Microsoft.Office.Interop.PowerPoint for this functionality. Following is the code which I have used. It sends the request to printer but nothing gets printed. if you guys have any knowledge plz help. string filename = "C:\\test.ppt"; ...

Receive WM_COPYDATA struct in WPF or Console C# app

I am writing a C# application that needs to communicate with another application written in native C. So far I have figured out how to send messages from my C# app to the C app with the User32.dll SendMessage. However I am unable to figure out how to get the C# app to RECEIVE messages from the C app. I have seen WinForms examples of ove...

Is there any possibility for Interop across a COM/.NET boundary between ADODB.Stream and System.IO.Stream?

I have a COM-Callable Wrapper on a .NET assembly. Some of the methods use streams (System.IO.Stream): either they accept a System.IO.Stream as input, or they return a System.IO.Stream . I'd like to call one of those methods from a COM environment - Classic ASP. Is there any possibility to get interop using ADODB.Stream? In other wo...

Right align WPF window title

I'm currently creating a WPF Exception Window, much in the style of the MessageBox (static show methods). In attempting to style it similarly, I have created a ExceptionWindowOptions enum which contains the value, RightAlign. When the RightAlign flag is tagged in the MessageBox class, the window title is aligned to the right (next to th...

P/Invoke Interop Assistant: Is this actually correct?

I've got the following structs in C++: (Using pragma pack 1) typedef struct _wfs_cdm_physicalcu { LPSTR lpPhysicalPositionName; CHAR cUnitID[5]; ULONG ulInitialCount; ULONG ulCount; ULONG ulRejectCount; ULONG ulMaximum; USHORT usPStatus; BOOL bHardw...

put wpf on a win hdl

Hi there, i get a winHdl (which is a winForm) from a native c++ application. Plugin implementation in c#: public int Create(int hParentWnd ...){ ... // here i want to put wpf on this hParentWnd } Now i want to put my WPF user control in this window. How can i do this? Any code snippets available? thanks ...

Registration-Free COM Interop and Dependent Assemblies

Hi folks - We are working on an integration of a large MFC-based application with a handful of managed (.NET) add-ins. Communication with these add-ins is done via COM. Historically, we've just used the registry to make these add-ins available (as COM servers) to the application. But, now we're trying to use registration-free COM inter...

How to display managed control on native window?

Using C++/CLI, How to display a managed control (eg. System::Windows::Forms::Panel^) on a window created in native code? An external program calls my native method where i can access it's window via SubclassWindow(hNativeWindow, MyNativeWindowProc); Then I create control with something similar to: MyNameSpace::MyControl^ ctrl = osoz...

Add a function in my .NET application as an event handler in another .NET application

We have a .net application that we didn't develop, but use. I can tell using reflector that this application has 1) a static variable in the form main form that is a reference to that "main" form and 2) has an event that is fired that I want to be able to take action based upon. I know what I'd do if it was in my application (mainForm....

Working with HResult, interop and related things in C#

Hi guys, I am working on a project in C# to create a forms application. I would like to use IFileDialog and other functionality that is part of the native Windows API (or however ti should be called). Starting out I knew absolutely nothing about interop or the Windows API. I am starting to learn but at times it can be hard to find very...

WCF Interop with PHP behind a load balancer

I'm trying to help a customer interop w/ a PHP client but we have a load balancer that is in front of the IIS farm. Because of this when you actually view the .svc?wsdl you get specific server listed inside this WSDL. Then when my customer is trying to generate a client using something like so $client = new SupplierService(); They g...

Why am I getting an Out of Memory Error doing ASP .NET Excel Interop?

This was working..and I moved the disposal code to the finally block, and now it fails every time. I have a test spreadsheet with 4 records, 6 columns long. Here is the code I'm using to bring it in. This is ASP .Net 3.5 on IIS 5 (my pc) and on IIS 6 (web server). It blows up on the line right before the catch: "values = (object[,])ran...

What is the interop dll?

Hi guys, This might be a bit of stupid question but i need some clarification. I have Reportwriter dll that uses crystals reports. It is written in VB6. I have to add this dll to my asp.net project, where it creates an interop dll. To my understanding, the interop dll is there as a intermediatary so that my .net code can speak to the r...

Way to consume a Java-Spring Service from .NET

What is the the most hassle-free (even commercial) way to consume a Java service (resides in Spring container) from c# ? ...

How do I get ToolStripMenuItem Shortcut Key to work when WinForms control is hosted in VB6 Form.

We have a scenario where we are exposing a set of WinForms UserControls via COM to a Legacy VB6 application. We have 3 different controls which have a MenuStrip on it that has the Control-F shortcut key mapped to a menu item which invokes a control specific find items dialog when the shortcut is entered. When we try testing this code in ...

Loading an assembly from a win32 application without having .NET framework installed

I know it's possible to run a .NET application using a portable Mono executable without having .NET framework installed but is it possible to load and use an assembly is this situation? thanks in advance. ...

Calling unmanaged function from C#: should I pass StringBuilder or use unsafe code?

I've got a C# program that needs to pass a char buffer to an unmanaged function. I've found two ways that seem to work reliably, but I'm not sure which I should choose. Here's the unmanaged function's signature. extern "C" __declspec(dllexport) int getNextResponse(char *buffer); The first option is to define the buffer as a StringBui...

C# COM Interop Library

Hey all, I am currently porting a legacy VBA application to a .Net application. During this process the users of the existing VBA application need to have some features added. So instead of coding them in VBA & then later in C#, I’ve wrote the new functionality in C# and I want to expose this to the existing VBA application through COM, ...

How does this strange 32-bit/64-bit interop solution work?

I'm currently maintaining a piece of software that we outsourced couple of years ago and that is poorly documented. The piece is a COM server for consuming by third-party applications and an installer that does all necessary deployment. There's the core compiled as 32-bit DLL and meant to be used from 32-bit applications. And there's al...