interop

Calling Bash Commands From Ruby

How do I call console/bash commands from inside of a Ruby Program? Also, how do I get output from these commands back into my program?...

C++ Problems with #import of .NET out-of-proc server.

In C++ program, I am trying to #import TLB of .NET out-of-proc server. I get errors like: z:\server.tlh(111) : error C2146: syntax error : missing ';' before identifier 'GetType' z:\server.tlh(111) : error C2501: '_TypePtr' : missing storage-class or type specifiers z:\server.tli(74) : error C2143: syntax error : missing ...

Java and c# interoperability

I have two programs one in c# and another one in Java. Those programs will, most probably, always run on the same machine. What would be the best way to let them talk to each other ? ...

Getting UI text from external app in C#

Is it possible to get UI text from an external application in C#. In particular, is there a way to read Unicode text from a label (I assume it's a normal Windows label control) from an external Win32 app that was written by a 3rd party? The text is visible, but not selectable by mouse in the UI. I assume there is some accessibility AP...

How do I stop MS Graph component popping up during Interop?

When using Office Interop in C#, if you insert a chart object into a MS Word document, the Grap application loads up very briefly and then goes away. Is there a way to prevent this from happening? I have tried setting the Visible property of the application instance to false to no effect. EDIT: The Visible property does take effect when...

How to work around unsupported unsigned integer field types in MS SQL?

Trying to make a MySQL-based application support MS SQL, I ran into the following issue: I keep MySQL's auto_increment as unsigned integer fields (of various sizes) in order to make use of the full range, as I know there will never be negative values. MS SQL does not support the unsigned attribute on all integer types, so I have to choo...

What do I need to do to implement an "out of proc" COM server in C#?

I am trying to implement an "out of proc" COM server written in C#. How do I do this? I need the C# code to be "out of proc" from my main C++ application, because I cannot load the .NET runtime into my main process space (WHY?: My C++ code is in a DLL that is loaded into many different customer EXE's, some of which use different version...

How to marshal an array of structs - (.Net/C# => C++)

Disclaimer: Near zero with marshalling concepts.. I have a struct B that contains a string + an array of structs C. I need to send this across the giant interop chasm to a COM - C++ consumer. What are the right set of attributes I need to decorate my struct definition ? [ComVisible (true)] [StructLayout(LayoutKind.Sequential)] public...

How do I Convert an IntPtr to a Stream?

class Foo { static bool Bar(Stream^ stream); }; class FooWrapper { bool Bar(LPCWSTR szUnicodeString) { return Foo::Bar(??); } }; MemoryStream will take a byte[] but I'd like to do this without copying the data if possible. ...

How well does WPF blend with XNA in real life?

I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pitfalls (such as the "airspace problem")? Any hint on what app...

What is the best way and recommended practices for interacting with Lotus Notes from C#

In particular, I have to extract all the messages and attachments from Lotus Notes files in the fastest and most reliable way. Another point that may be relevant is that I need to do this from a secondary thread. Edit Thanks for the answers - both of which are good. I should provide more background information. We currently have a Wi...

Exposing .net methods as Excel functions?

I have a set of calculation methods sitting in a .Net DLL. I would like to make those methods available to Excel (2003+) users so they can use them in their spreadsheets. For example, my .net method: public double CalculateSomethingReallyComplex(double a, double b) {...} I would like enable them to call this method just by typing a ...

Can't access variable in C++ DLL from a C app

I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put extern "C" _declspec(dllexport) char* MyNewVariable = 0; which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I can't figure out how to declare the variable so that I can acc...

How do I locate a Word application window?

I have a VB.net test application that clicks a link that opens the Microsoft Word application window and displays the document. How do I locate the Word application window so that I can grab some text from it? ...

What is the best way to make a .net client consume service from a Java server ?

I have a user interface in .net which needs to receive data from a server, on a request/reply/update model. The only constraint is to use Java only on the server box. What is the best approach to achieve this ? Is it by creating a Webservice in Java and then accessing it in .net, or should I create Java proxies and convert them in .net ...

Define an interface in C++ that needs to be implemented in C# and C++

I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface definitions, one in C++ and one in C#. I then expose the C# interfaces as a COM server. ...

Sample code for using IBM's PCOMM in C# o write an as400 screenscraper

Has anybody used C# to write a sample screen scraper for IBM as400? ...

How to rewrite or convert C# code in Java code ?

I start to write a client - server application using .net (C#) for both client and server side. Unfortunately, my company refuse to pay for Windows licence on server box meaning that I need to rewrite my code in Java, or go to the Mono way. Is there any good way to translate C# code in Java ? The server application used no .net specifi...

Help in creating Zip files from .Net and reading them from Java

I'm trying to create a Zip file from .Net that can be read from Java code. I've used SharpZipLib to create the Zip file but also if the file generated is valid according to the CheckZip function of the #ZipLib library and can be successfully uncompressed via WinZip or WinRar I always get an error when trying to uncompress it using the J...

Should I use a state machine or a sequence workflow in WF?

I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an agenda template, update the agenda with the Excel data, creat...