interop

Java ANSI X923 Padding

I have a new application written in java that needs to read encrypted values out of a db. The problem is that all the values in the db were encrypted by .NET code that uses the ANSI x923 padding scheme. I have done some research and it doesn't look like the Java TripleDes libraries have a way to specify this padding scheme. I was wond...

sending structs over sockets

Hi, i am using vb.net and i would to send some structs to a C++ tcp server. The problem is the structs i am sending might contain other structs. Struct{ uint length; byte really; customStruct customStuff; }FirstStruct; Struct{ uint length; char[] name; }CustomStruct; Lets say i want to send FirstStruct over to the C++...

Arguments for CloseHandle() winapi call in .net

When accessing the winapi method CloseHandle() via .net P/Invoke, should the argument be IntPtr or HandleRef, and why? ...

Cross User COM Interop

I am using a third party database. A host application runs the database, and allows client applications to connect to the server app over COM. I am running Windows 2003 Server, and writing all of my code in C#. On the server, I login as UserA, and am able to launch the host application locally, and then run a client app that I have writ...

How to get Excel to ignore apostrophe in beginning of cell

I'm writing a tool that syncs a simple database with Excel sheets. Each item in a table in the database corresponds to one row in the worksheet. I read the Excel into the tool using C# and the Excel interop com interface, and compare the items' values (i.e. one of the columns in the excel sheet) after the sync just to make sure that they...

Outlook MAPI session exception when outlook interface is closed

I'm developing a email sender that retrieve data from a database, build up a MailItem with the Outlook Interop and send it. My email sender is running by a windows service that is notified everytime there's some data to send. I'm logging on the MAPI session of Outlook without problem and everything seems to work. But... when someone o...

Convert stdole.StdPicture to System.Drawing.Icon

I have a COM object (VB6 ActiveX exe) that returns a stdole.StdPicture through interop. Is there a way to convert that to a System.Drawing.Icon? Or is there a better return type for my COM object to return? What I'm trying to do is have my C# code use an icon from my VB6 code. ...

Interprocess Communication in C++

I have a simple c++ application that generates reports on the back end of my web app (simple LAMP setup). The problem is the back end loads a data file that takes about 1.5GB in memory. This won't scale very well if multiple users are running it simultaneously, so my thought is to split into several programs : Program A is the main exec...

Get drag & drop to work in WPF which already works in Windows Forms

I am trying to use this function from a COM API which enables the window to receive drops (as in drag & dop) from another application. It is pretty straightforward in Windows Forms and works: public void EnableDropSupport(System.Windows.Forms.Form form) { IntPtr hwnd = form.Handle; _comAPI.RegisterDropWindow((int)hwnd); } But I...

.Net - Can a Class Library (dll) written in .Net be used by an application written in C or C++?

Let's say I have written a Class Library (dll) in .Net and now I have developers using it in their .Net applications. However, the library itself could probably be useful also for developers writing natively (in C or C++). So my question is if my managed dll can be used in C or C++? If not, why? Maybe I must add some specific code to ...

Call a method in a WPF app from Flash swf or exe

I'm working on a WPF app that needs to host some Flash content. The plan is create an exe from the Flash content, then invoke the exe from the WPF app (the option of hosting swf content inside a WebBrowser control was discussed but deemed to be too slow for this application). Is it possible for the Flash application to call a method in...

How do I dispose of a VB6 COM object i'm using via an interop assembly from IronPython?

Hello. I'm using a third party COM component by means of a .NET interop assembly in IronPython, as seen here: http://stackoverflow.com/questions/1237200/how-can-i-use-a-vb6-com-reference-in-ironpython My experience in this area has been great, I'm very impressed by the amount of stuff that works seamlessly... except one thing. The 3rd...

Clean Unmanaged memory

Hi all, Whenever i use one function from unmanaged dll in Usercontrol, I got this error. "System.AccessViolationException: Attempted to read or write protected memory. This is often a indication that other memory is corrupt." But it only happens if I use this function so many times. But I need to use this function every 3 minutes....

deployment strategy on .NET app that uses COM objects

Hi guys, I have a question regarding the deployment strategy on a .NET app. In my app, I'm using DSO (decision support objects), it's a COM dll that is used to access an Analysis Services Server (version 2000). I've referenced the COM from the solution, and Visual Studio (actually the tool behind) nicely created a .net assembly that w...

C# - Excel Number Formatting Issue with International settings

I am trying to write to an Excel 2003 spreadsheet using c# 3.5. However I am unable to get this to function correctly across different country settings. The country settings are either English or German. These two settings have different decimal and thousands settings. Everything works fine unless a user has changed the decimal and thous...

Unmanaged base class with Managed subclass

Is it possible to have: A pure abstract class (basically an interface) in (unmanaged) C++ Have managed implementations of this class in <insert .net language of your choice> Consume these managed implementations from (unmanaged) C++ Using SWIG or some C++/CLI glue? ...

Is IOverlay interface available in DirectShow.Net

Hi I am pretty new to DirectShow and really just feeling my way round at the moment. I am wanting to host the directshow renderer window of a directshow graph within a WPF app and am currently using the HwndHost class to try to achieve this. What I need though for HwndHost is a handle to the window which is rendering the video. I have f...

Call Scala code from Java?

I'm using Netbeans to write Scala and Java. Netbeans generated a .jar file for the Scala project. I tried importing that file in the Java project. But I couldn't import any class from that .jar file into my Java project. I also tried importing scala-library.jar to the java project, and could import classes from that jar. I want to wri...

How to properly clean up interop objects in C#

This is a follow on question to How to properly clean up excel interop objects in c#. The gyst is that using a chaining calls together (eg. ExcelObject.Foo.Bar() ) within the Excel namespace prevents garbage collection for COM objects. Instead, one should explicitly create a reference to each COM object used, and explicitly release the...

Hosting PreviewHandlers on x64 gives REGDB_E_CLASSNOTREG

So this is the case, I am using the http://www.codeplex.com/C4FDevKit, I want to use the PreviewHandlerHost control in my desktop application I successfully been able to do it and test it on XP 32, 64 bits and Vista 32, 64 bits the issue only appeared on XP x64, This is the exception message Unable to cast COM object of type 'Sys...