interop

Updating a checkbox in Excel 2003 from a background thread in C# fails sometimes

Hi, I have created an Add-In in C# that implements user defined functions for Excel. These UDF's return immediately, but they control background asynchronous procedures. These procedures have status that needs to be monitored and presented to Excel. I have chosen to display the status using checkboxes. A background thread then update...

How should I declare this C struct for interop?

I have to use a legacy C routine in the application I am developing. The code in here works, but I have to convert almost all the fields to char arrays in order to use it. There is a better way to do it? I have tried some version using strings, all to no avail. This is the code found in the original header file... typedef struct PXUCAM...

Interoperate between C# and Java using web services without a Java EE application server?

I'm in a difficult position: We have a 3rd party enterprise system that exposes a Java-based API. However, we are a 100% .Net oriented development team. Essentially, I need to wrap the Java API with something that C# code can call. Web services would be great, but the only Java application server supported on our infrastructure is ...

IntPtr addition

So from what I can tell, every managed example of IntPtr addition I have found is WRONG. For example: http://www.atalasoft.com/cs/blogs/stevehawley/archive/2006/10/16/10987.aspx My thought being, that if IntPtr is at (or near) int32.MaxValue on a 32-bit system, and you add an offset which overflows int32, isn't that still a valid memor...

Which do I choose for hosting my in-proc server in a separate process - COM+ or DCOM?

I need to shield a 64-bit COM component consumer from the 32-bit native C++ ATL in-proc COM component. Seems like both COM+ and DCOM can host my in-proc component in a separate process and do the marshalling so that both me and the consumer application don't care of it and I even don't have to change my in-proc component at all. I tried...

Excel Interop "FindAll" Method

This may be a duplicate question, but really don't know how else to word the title. Has anyone been able to find a method in the Excel Interop Library that exposes the "Find All" functionality from the "Find and Replace" dialog? There is Find, FindNext and FindPrevious, but no FindAll, which is odd. So far, this is the way I'm doing i...

communication between Java and C#

Hi, I found out that there is a .Net toolkit called GCT - Group Communication Toolkit that is the C# version of JGroup. I want to know whether this and JGroup can be connected together to make java and C# clients communicate with each other. If not, what would be the best option to make a java program and a C# program communicate? One ot...

How does COM select how to marshal an interface?

As I get it there're three ways to implement marshalling in COM: typelib marshalling proxy/stub marshalling implementing IMarshal by the object now how does the component consumer (user) choose which one will be used? Does it decide on its own and use the preferred way or does it call some built-in function and it solves the problem ...

debugging c# silverlight projects from vb web application

Hi, I have a problem whereby I cannot debug a c# silverlight application project that is hosted from within a visual basic web application. I add breakpoints to the main App constructor and the symbols are loaded ok but my breakpoints are never hit. I have concluded that it is a vb/c# interop problem as to test i did the following. ...

Error when instantiating .NET/COM interop class via classic ASP

Hi all, I am having a problem when trying to instantiate a C# .NET class that's been exposed to COM in a classic ASP application. I've used tlbexp to generate a typelib and registered it in Component Services; now when trying to create the object as such: Server.CreateObject("The.Class.Name") I am getting the error: Server object er...

How to dispose of a NET COM interop object on Release()

I have a COM object written in managed code (C++/CLI). I am using that object in standard C++. How do I force my COM object's destructor to be called immediately when the COM object is released? If that's not possible, call I have Release() call a MyDispose() method on my COM object? My code to declare the object (C++/CLI): [Gui...

java libraries specifically for use with windows

Background: A long time I remember reading about a Java library that was created specifically to handle routine operations on Windows operating systems. It had, for example, native routines for handling things like "shortcut" creation, and all those cute little quirks of windows filepaths. It was touted as being the "missing library" f...

Using Unreal 3 Engine within a .NET application

Now that the Unreal Development Kit for Unreal 3 engine is free I am thinking about utilizing it for an appication. Do you think it is possible to emebedd a Unreal 3 powered 3D window into a .NET (WPF or Windows Forms) and control parts of the gameobjects therein using c#? Is the engine plain c++? Or COM or is there a .NET wrapper or som...

AccessViolation when calling unmanaged dll

When calling an unmanaged Dll from a c# application I get an AccessViolationException. The strange thing is that the exported function has no arguments, so the problem is not in the Marshalling of data. The function gets no argument and just returns an integer. Also note that calling convention is not an issue. An identical function with...

Getting a byte array from out of process C++ COM to C#

What's the best way to get a chunk of memory (i.e. void*) from a COM server to C#? We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we tried this on x64 CLR with x32 C++ COM it blows up. The COM has to be x32 because it uses external 32 bit DLLs. The C# could be forced to r...

Implement a Comet server in C#

I would like to know whether there is a way to write a comet server in C#. i have a C# code that generates data periodically, and I want to push these data to a java app. So would like to convert my C# code to a comet server. Also would like to know whether there is any comet server implemented that lets us connect the C# application an...

How can i add a button to all windows explorer instances ?

Hi, I am trying to add a button to one of the existing tool bars in any windows explorer instance. After much research i figured out that BHO (browser helper objects) are the best way to hook to windows explorer. My question is : Is that the correct way to go about it ? In the SetSite of the BHO i get the comObject that is the e...

Supporting Outlook 2003 and 2007 at the same time with interop

Is it possible to access Outlook 2003 and 2007 from the same application, using the primary interop assemblies provided by Microsoft? I have read that it is very difficult (if possible at all) to develop for different versions of Outlook on the same machine, because of the way COM versioning is handled. Are we better off using Outlook R...

Marshalling an array of structures from C++ to C#

In my C# code I'm trying to fetch an array of structures from a legacy C++ DLL (the code I cannot change). In that C++ code, the structure is defined like this: struct MyStruct { char* id; char* description; }; The method that I'm calling (get_my_structures) returns a pointer to an array of MyStruct structures: MyStruct* get...

Unclear exception when compiling ASP.NET project

I have an asp.net application, with a number of referenced dll's. Now it seems when compiling the project I keep getting this one error: The specified module could not be found. Exception from HRESULT: 0x8007007E I See that one of the dll's that get referenced is the interop.dll, I suspect this error comes from the fact that intero...