interop

Java connection to / between Microsoft Windows Office Suite?

喜你入骨 提交于 2019-12-06 09:44:00
I read elsewhere (a response by "hazzen" here ) that .NET has "a binding for the entire Office suite outlined here that allows you to write COM-based methods that you can call from Office. It is intended for automation, but you can write any managed code you want and have Excel call into it." I'm interested in the same thing for Java. My present solution runs a standard Windows program that launches Java, whereupon any results are essentially sent to standard out and the intermediate program captures these and feeds the result back in to Excel - also using what amounts to std-out. There has to

Unmanaged DLL causing AccessViolationException

左心房为你撑大大i 提交于 2019-12-06 08:43:03
This one is really starting to give me a headache :( I have an unmanaged DLL that I'm trying to interop with and it's not going well. The application will sometimes work...but most times, randomly through an AccessViolationException and crash horribly. I think I've narrowed it down to my mishandling of a single DllImport: C++ function: HTMLRENDERERDLL_REDIST_API void SetDataBuffer( int windowHandle, unsigned char* dataSource, int format, int stride, int totalBufferSize ); C# DllImport: [DllImport("MyDll.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] static private

How can I pass a JavaScript function to Silverlight?

邮差的信 提交于 2019-12-06 08:42:48
问题 I'm evaluating the JavaScript/Silverlight interop capabilities and have been able to create a Silverlight instance using JavaScript and call methods on it. However, I now need a way of passing a JavaScript callback function to Silverlight. Simply passing a JavaScript function to a Silverlight method expecting an Action doesn't work although the error suggest that it's intended to. What am I missing? The exception details: Microsoft JScript runtime error: System.ArgumentException: Cannot bind

C# Visual Studio: How to have multiple developers on a solution that references Office?

China☆狼群 提交于 2019-12-06 08:33:26
问题 When I add a reference to Office COM Library, I to go: References Add Reference Select the COM tab Select Microsoft Office 12.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>4</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False<

Communicate between c++ applications and web applications

女生的网名这么多〃 提交于 2019-12-06 08:02:19
What are the various ways I can achieve communication (like function calls) from a web application to a c++ application? I've developed the c++ application to do image processing and want to display and transmit the result in real time to a web-page displayed on a browser. Nothing will 'transmit to a web browser'. Web browsers have to ask, and then you can respond with the data you want to display. As per @The MYYN, you can just have the C++ code drop suitable files and the browser can ask for them. Or, you can set up some sort of webapp. If you use Ajax you can get the browser to poll for

c-fortran interoperability - derived types with pointers

依然范特西╮ 提交于 2019-12-06 07:57:08
I have long fortran code that has to be made usable from python. I decided to do Fortran->C->Python interface. I got a problem: I have derived types within Fortran modules that contain double precision, allocatable type as members. When trying to compile with ifort I get (with gfortran something similar): Each component of a derived type with the BIND attribute shall be a nonpointer, nonallocatable data component with interoperable type and type parameters This is actually with agreement with Intel compiler documentation and Fortran 2003 standard: point 15.2.5. Is there any way to access

Marshalling ArgIterator to va_list

五迷三道 提交于 2019-12-06 07:47:31
So, I got an idea to try to p/invoke C functions that take va_list . I know how to p/invoke classic varargs functions (with __arglist ), and as it seemed to me that va_list works just like an ArgIterator , I thought it might be possible to just pass it to the method: [DllImport("msvcrt.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern int vswprintf(StringBuilder str, int length, string format, ArgIterator args); public static int vswprintf(StringBuilder str, int length, string format, __arglist) { return vswprintf(str, length, format, new

Need suggestions on how to extract data from .docx/.doc file then into SQL Server

懵懂的女人 提交于 2019-12-06 07:33:16
问题 I'm suppose to develop an application for my project, it will load past-year examination / exercises paper (word file), detect the sections accordingly, extract the questions and images in that section, and then store the questions and images into the database. (Preview of the question paper is at the bottom of this post) So I need some suggestions on how to extract data from a word file, then inserting them into a database. Currently I have a few methods to do so, however I have no idea how

P/Invoke with Shell32, bypass Interop.Shell32.dll generation

醉酒当歌 提交于 2019-12-06 07:19:55
问题 So I'm using the following code to dump every extended file attribute to the debug console... ShellClass shellClass = new ShellClass(); Folder dir = shellClass.NameSpace(Path.GetDirectoryName(sFilePath)); FolderItem item = dir.ParseName(Path.GetFileName(sFilePath)); for (int i = 0; i < 267; i++) { System.Debug.WriteLine(dir.GetDetailsOf(item, i)); } As Shell32 is a non-managed library, I can't embed the DLL resource in the program directly, and it has to generate an interop helper DLL. Anyone

Windows Phone 7/WPF - Sharing a codebase

被刻印的时光 ゝ 提交于 2019-12-06 07:12:13
问题 I've developed Windows Mobile apps in the past and have always found that when trying to share a codebase with Windows (Winforms/WPF) apps, generally things get very difficult. Has this changed with Windows Phone 7? It would be great to add a WP7 app to a solution containing a WPF app and ASP.NET site and have everything share the same code base. 回答1: Have a look at the Portable Library Tools CTP here It's a Visual Studio add-in that enables you to create libraries that run on a variety of