All Questions

645
votes
36answers
259370 views

How do I properly clean up Excel interop objects?

I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause: while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { } exce...
809
votes
19answers
410850 views

Calling shell commands from Ruby

How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?
11
votes
2answers
5809 views

How to post messages to an STA thread running a message pump?

So, following this, I decided to explicitly instantiate a COM object on a dedicated STA thread. Experiments showed that the COM object needed a message pump, which I created by calling Application.Run...
9
votes
2answers
2383 views

Clean up Excel Interop Objects with IDisposable

In my company the common way to release Excel Interop Objects is to use IDisposable the following way: Public Sub Dispose() Implements IDisposable.Dispose If Not bolDisposed Then Finalize...
190
votes
11answers
162272 views

How can I make SQL case sensitive string comparison on MySQL?

I have a function that returns five characters with mixed case. If I do a query on this string it will return the value regardless of case. How can I make MySQL string queries case sensitive?
13
votes
6answers
16599 views

C++/CLI Mixed Mode DLL Creation

I've got a native C++ DLL that I would like to have a C++/CLI wrapper layer for. From what I understood, if you simple added a C++/CLI class to the project, VS would compile as mixed mode, but I was ...
43
votes
7answers
88540 views

Write Array to Excel Range

I'm currently trying to write data from an array of objects to a range in Excel using the following code, where objData is just an array of strings: private object m = System.Type.Missing; object[] o...
55
votes
7answers
25093 views

Excel Interop - Efficiency and performance

I was wondering what I could do to improve the performance of Excel automation, as it can be quite slow if you have a lot going on in the worksheet... Here's a few I found myself: ExcelApp.ScreenUp...
32
votes
4answers
53039 views

A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6?

I have a simple class library written in c#. using System; namespace TestDll { public class Test { public string HelloWorld { get { ret...
28
votes
6answers
54245 views

Calling C# code from C++

I need to be able to invoke arbitrary C# functions from C++. http://www.infoq.com/articles/in-process-java-net-integration suggests using ICLRRuntimeHost::ExecuteInDefaultAppDomain() but this only all...

Previous Next