interop

How to use Office from Visual Studio C#?

白昼怎懂夜的黑 提交于 2019-12-03 05:48:57
The technique for adding a reference to the COM interop of Office in Visual Studio is to go to: References Add Reference Select the COM tab Select Microsoft Office 11.0 Object Library And magically named reference appears: Microsoft.Office.Core The Project.csproj file shows the details of the reference: <COMReference Include="Microsoft.Office.Core"> <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid> <VersionMajor>2</VersionMajor> <VersionMinor>3</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False</Isolated> </COMReference> And the project is checked into source

Associating git commits with Team Foundation work items

℡╲_俬逩灬. 提交于 2019-12-03 05:07:08
问题 Context A GitHub Enterprise installation used for development. Every developer has his own public repo, and the organization has the authorative repo. Pull requests are used for code reviews, and we loosely follow nvie's git flow branching model. A TFS installation used for issue tracking and deployment (the release branch). We mirror the release branch into a TFS repo. Work Items Now the hard part is: How do we associate git commits (that may originally be done on the public branches of the

Implement callback C# functions for C++ DLL

拟墨画扇 提交于 2019-12-03 04:49:48
I'm writing a DLL wrapper for my C++ library, to be called from C#. This wrapper should also have callback functions called from the library and implemented in C#. These functions have for instance std::vector<unsigned char> as output parameters. I don't know how to make this. How do I pass a buffer of unknown size from C# to C++ via a callback function? Let's take this example CallbackFunction FunctionImplementedInCSharp; void FunctionCalledFromLib(const std::vector<unsigned char>& input, std::vector<unsigned char>& output) { // Here FunctionImplementedInCSharp (C# delegate) should somehow be

CUDA for .net?

一世执手 提交于 2019-12-03 04:14:28
问题 I know that there are a lot of CUDA language bindings, such as PyCUDA, but are there any good bindings for .Net? The only one I've seen is this one, but I'd like to know if there are any others. 回答1: Here's another library: http://sourceforge.net/projects/brahma-fx/ Edit : I've been looking at the documentation for the project you initially listed, and can say that the interface makes me think: what is the point of using .Net. The project I've listed has a cleaner interface but no

Why is COM interop preferred over P/Invoke in .NET?

余生长醉 提交于 2019-12-03 04:06:57
In our project we are reusing lot's of Delphi code through COM in our asp.net application. Like this: legacy delphi dll => delphi COM wrapper => .Net interop => asp.net (mvc) We have some issues regarding access violations, unloading of dll's, etc... I have now ported some to use the legacy dll directly through P/Invoke code. When I look at resources regarding COM and P/Invoke, people almost always advice to use COM. Why is that? Doesn't P/Invoke have the following benefits: checked out code will always use the correct dll‘s instead of the last registered COM Multiple versions can run side by

Portable / Interoperable WCF Contracts

血红的双手。 提交于 2019-12-03 03:52:26
I was wondering if anybody out there had some good tips/dos and don'ts for designing WCF contracts with a mind for web-service interoperability, both in terms of older Microsoft web service technologies (e.g. WSE) and non-Microsoft technologies such as Java calling WCF web services. For example: are there any special rules that need to be taken into account when exposing DateTime as a type in your contract? How about Dictionaries and Hashtables? What are the issues you might run into with the various bindings available? WCF DateTime woes Regarding your DateTime question, you are right to be

C# Outlook interop and OpenSharedItem for opening MSG files

做~自己de王妃 提交于 2019-12-03 03:49:05
Is there any tutorial or resource I can follow in order to use the OpenSharedItem outlook interop method. My goal is to read MSG files using it (as it can apparently do so). How to: Create a Contact Item from a vCard file and Save the Item in a Folder How to: Import Saved Items using OpenSharedItem Thanks Svetlozar, I've used the resources to create something like the following: Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); var item = app.Session.OpenSharedItem("C:\\test.msg") as Microsoft.Office.Interop.Outlook.MailItem; string body =

How to load program resources in Clojure

夙愿已清 提交于 2019-12-03 03:38:17
问题 How do you load program resources such as icons, strings, graphical elements, scripts, and so on in a Clojure program? I am using a project layout similar to that in many Java projects where there is a "resources" directory hanging off of a "source" directory. A jar file is created from the source and includes the resources, but I can't seem to get the resources loaded as I would in Java. The first thing I tried was something like (ClassLoader/getSystemResource "resources/myscript.js") But

ClojureScript interop

微笑、不失礼 提交于 2019-12-03 02:17:36
I am trying to find out how to access Javascript objects properties in ClojureScript. If I know in advance the name of the property, that is easy. To get foo.bar I just do (.-bar foo) Is there a way to access a property whose name is known only at runtime? I am looking for the equivalent of the JS syntax foo[dynamicBar] You can use aget / aset to access properties known only at runtime. ;; Use clj->js to convert clj(s) map to javascript. ;; Note the #js {:bar 100} reader literal indicating a js map. cljs.user> (def foo (clj->js {:bar 100})) #js {:bar 100} cljs.user> (.-bar foo) 100 cljs.user>

What exactly is the GNU tar ././@LongLink “trick”?

跟風遠走 提交于 2019-12-03 02:10:35
I read that a tar entry type of 'L' (76) is used by gnu tar and gnu-compliant tar utilities to indicate that the next entry in the archive has a "long" name. In this case the header block with the entry type of 'L' usually encodes the name ././@LongLink . My question is: where is the format of the next block described? The format of a tar archive is very simple: it is just a series of 512-byte blocks. In the normal case, each file in a tar archive is represented as a series of blocks. The first block is a header block, containing the file name, entry type, modified time, and other metadata.