interop

Call method in already running .NET assembly from different app.

I don't know if you can do this, but basicly I need to be able to call a method in already running .NET process from a different assembly that don't share the same process. Basically what I have is a application and when it calls a .net method it loads the assembly that contains that method into into a appdomian and then calls the metho...

Unable to add a DLL Reference to VS 2008

Hi, I wonder if someone can help me. I'm trying to add a reference to the LAME MP3 encoder in my VB.Net (3.5) App. The DLL I'm using (lame_enc.dll v3.98.2) was downloaded from here: http://rarewares.org/mp3-lame-bundle.php When I try to add the DLL reference to my project, I get an error: "A reference to C:\\Lame_Enc.dll could not be ...

passing c# string argument to fortran 77 dll

Need help , in passing passing C# string to FORTRAN 77 dll as argument. FORTRAN 77 code: *$pragma aux CHARIN "CHARIN" export parm(value) SUBROUTINE CHARIN(FCHAR) C Declarations CHARACTER*(*) FCHAR C PRINT*,FCHAR C RETURN END C# code: using System; using System.Collections.Generic; using System.Text; us...

What is a String[*] and how do I cast it?

I'm currently in the unfortunate position of having to call a VBA macro from C#, via the COM Interop. The macro returns an array of strings and looks something like: Public Function Foo() As String() which I'm then trying to cast to an array of strings in C# like this: var result = (string[])xlApp.Run("Foo", ... missing args ...) w...

How do I use a COM component from VB.NET?

How do I access a COM component from an ASP.NET page. I added reference to my ASP.NET project. The actual dll I got from the 3rd party is ePadIIu.dll but when I added it to the ASP.NET project it shows as ePadIIu.interop. I want to access all the methods and properties in the component. The sample I received from the 3rd party softwa...

Pass key press from win forms to wpf

I have a windows forms Form that has a menu bar that grabs Ctrl-C. Inside the form's copy handler is a switch statement calls the correct copy method depending on what kind of control is selected. I have now added a WPF UserControl as one of the child controls. In the UserControl, is a TextBox. I would like to have Ctrl-C activate th...

How can I invoke a static method on a .NET object over COM interop?

Is it possible to invoke a static method on a .NET Object, via COM interop? I know I could write a wrapper class. What if I don't wanna do that? ...

Class Not Registered.... when trying to call a managed C# library from unmanaged C++

Hey everyone, I have a C# library that I am using for a COM object in unmanaged C++ code. I registered the library using Visual Studio's checkbox "Register For Com Interop" and set ComVisible to true. imported the tlb to the C++ app..... when I run it, I get a "Class Not Registered".... This has worked before, but this started happen...

C++/CLI ref class using a win32 thread

I'm trying to encapsulate some older win32 code in a C++/CLI ref class to make it better accessible from .NET code. This class needs to start a Win32 thread and pass a pointer to the class as a thread parameter. The code looks something like this: ref class MmePlayer { int StartPlayback() { hPlayThread = CreateThread(NUL...

So, .NET doesn't have built-in Office functionality?

I always thought it did, though I don't know where I got the idea... I'd always assumed it was easy to treat a spreadsheet as a 2D array for instance, but some searching on SO suggests everyone is using 3rd-party libraries? Or, are all those people needing a solutions which doesn't require Office to be installed... if I don't have this r...

Open Lotus Notes database by Replica ID in C#

I created a program a while ago using C# that does some automation for a completely different program, but found that I need to access data from a Lotus Notes database. The only problem is, I can only seem to figure out how to open the database by the server's name (using session.GetDatabase())... I can't figure out how to open it by Rep...

What is the best way for C# app to communicate unix c++ app

the ways I can think of Web service or soap Socket Database table shared file Any concise example you know of for webservice? ...

Listening to HTML Events from BHO

I've been working on a BHO/toolbar written in C# that listens to HTML events raised on the browser's current webpage. The solution includes a reusable class called HtmlPageEventManager whose purpose is to subscribe to a given list of HTML events for each new webpage that's opened. A goal is to attach handlers as soon as the user can be...

J++ to Java: how to migrate from RNI to JNI?

I've inherited a legacy J++ project. I've upgraded this project to standard Sun Java successfully. However, this project includes a native C++ dll which the Java code talks to via the Microsoft-specific RNI framework. Needless to say, calling System.loadLibrary("myRniNativeDll") now throws a UnsatisifiedLinkError, saying one of the dep...

Display Excel 2007 Document in Browser using COM

I want to display and edit MS Excel File from client side using ActiveX COM object. The user would be allowed to edit the file and save it to local PC. Then It can be uploaded to remote server. So, can you give me some example of displaying Word, Excel, Powerpoint etc document in Internet Explorer 8.0 using COM. I could not find such oc...

"Per Application" Audio Mixer in Windows XP

I need to mute and unmute sounds from other processes in Windows XP. I am looking for the best strategy. It is possible to write a Kernel Mode mixer that will filter the inputs to the output device? My other approach would be set Hooks for the various API's to intercept their Win32 calls. I would strongly prefer the less invasive approa...

WCF Interop with WSE2.0

I'm attempting, with great difficulty, to have an WCF client communicate with a WSE 2.0. The wse service requires UserName token for authentication and it would appear that this is not possible over an unsecured channel. I have configured the following custom bindings: <customBinding> <binding name="wse2Binding"> <te...

COM interface declarations

Hi, When creating COM interface declarations in C# are there any "rules" you have to stick to? I think there are and would like to get some info on it. For example I'm toying around with the ITaskbarList, ITaskbarList2 and ITaskbarList3 interfaces and it seems to me that I Have to declare the order of the members in the manages implem...

How to get type of COM object

I am referencing a COM library in Visual Studio, so it has automatically created the corresponding Interop assembly for me. I would like to do a GetType() on these com objects, but they always return System.__ComObject. Querying them for an interface works though: bool isOfType = someComeObject is ISomeComObject; //this works But what...

bool versus BOOLEAN in managed prototypes

I'm trying to create a managed prototype in C# for the [CreateSymbolicLink][1] API function. The prototype in WinBase.h is: BOOLEAN APIENTRY CreateSymbolicLink ( __in LPCWSTR lpSymlinkFileName, __in LPCWSTR lpTargetFileName, __in DWORD dwFlags ); And BOOLEAN is defined as a BYTE in WinNT.h. Fine. So my managed proto...