interop

Word Interop Not Working In A Scheduled Task

半腔热情 提交于 2019-12-03 12:57:52
问题 I'm currently developing a script that takes a Word document, opens it up in Word, and then prints the Word file as a PDF. Everything works great when run manually either on my machine or the server. The problem comes in when I attempt to run it as a scheduled task. One of the requirements is that this should be done nightly without any intervention. When I set up a schedule task to do this and set the security options to "Run only when user is logged on" everything works fine. Problem is,

Portable / Interoperable WCF Contracts

丶灬走出姿态 提交于 2019-12-03 12:38:38
问题 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

How can I wrap a COM object in a native .NET class?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 12:19:50
问题 I'm using an extensive existing COM API (could be Outlook, but it's not) in .NET (C#). I've done this by adding a "COM Reference" in Visual Studio so all the "magic" is done behind the scenes (i.e., I don't have to manually run tlbimp ). While the COM API can now be "easily" used from .NET, it is not very .NET friendly. For example, there are no generics, events are strange, oddities like IPicture , etc. So, I'd like to create a native .NET API that is implemented using the existing COM API.

How to distinguish different types of NaN float in Python

徘徊边缘 提交于 2019-12-03 12:10:59
I'm writing Python 2.6 code that interfaces with NI TestStand 4.2 via COM in Windows. I want to make a "NAN" value for a variable, but if I pass it float('nan') , TestStand displays it as IND . Apparently TestStand distinguishes between floating point "IND" and "NAN" values. According to TestStand help : IND corresponds to Signaling NaN in Visual C++, while NAN corresponds to QuietNaN That implies that Python's float('nan') is effectively a Signaling NaN when passed through COM. However, from what I've read about Signaling NaN , it seems that Signaling NaN is a bit "exotic" and Quiet NaN is

C# to C++ process with WM_COPYDATA passing struct with strings

ⅰ亾dé卋堺 提交于 2019-12-03 12:04:35
From a c# program I want to use WM_COPYDATA with SendMessage to communicate with a legacy c++/cli MFC application. I want to pass a managed struct containing string objects. I can find the handle to the c++ application for use with SendMessage fine. The bit I don't know about is how the struct and it's strings can be marshalled and read at the other end. Especially as it contains non-blittables. Do people think this is feasible? I'll continue to work on it, but would apprecite someone who's done this sort of thing telling me if it just isn't going to work. Here is some demo code if it was a c+

ClojureScript interop

一曲冷凌霜 提交于 2019-12-03 11:53:23
问题 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] 回答1: 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

How to pin a pointer to managed object in C#?

徘徊边缘 提交于 2019-12-03 11:39:47
Unmanaged code calls my functions. In first function I should pass back pointer to my managed object. Sometimes later some of my other functions get called with that same pointer as one of parameters . I should dereference it and use it to perform some calculations and then if it is not needed dispose of it. To cut the story short I need to pin that object so that GC won't move it til I dispose of it. How to do that in C# ? Thanks in advance. Alex F To pin an object in C#, you can use GCHandle.Alloc method with second parameter GCHandleType.Pinned . Object remains pinned until GCHandle

How does Spark interoperate with CPython

霸气de小男生 提交于 2019-12-03 11:15:44
I have an Akka system written in scala that needs to call out to some Python code, relying on Pandas and Numpy , so I can't just use Jython. I noticed that Spark uses CPython on its worker nodes, so I'm curious how it executes Python code and whether that code exists in some re-usable form. PySpark architecture is described here https://cwiki.apache.org/confluence/display/SPARK/PySpark+Internals . As @Holden said Spark uses py4j to access Java objects in JVM from the python. But this is only one case - when driver program is written in python (left part of diagram there) The other case (the

Creating Win32 events from c#

╄→гoц情女王★ 提交于 2019-12-03 11:13:10
I'd like create a kernel(aka named events) from C#. Do I have to interop services and wrap the native CreateEvent function or is there already a .NET class that does the job? The function that I need to run should be something like this: hEvent = CreateEvent ( NULL , false , false , "MyCSHARPEvent" ); This should notify all procs that probing forMyCSHARPEvent about the event. If there is a need to wrap the function, how would I translate the SECURITY_ATTRIBUTES struct from C# to win32? Take a look at the EventWaitHandle class. It's supported from .Net 2.0 onwards and allows creation of named

What is the difference between AxInterop and Interop?

删除回忆录丶 提交于 2019-12-03 11:00:33
I've added an .ocx to the toolbox in VS. Two .dll's were created: Interop.NNN.dll, AxInterop.NNN.dll. What is each one? Are they both required? The AxFoo.dll assembly contains an automatically generated class that's derived from the System.Windows.Forms.AxHost control. It is pretty simple, it has methods, properties and events, the same ones you have available in the .ocx, that simply call the Foo.dll interop library. So, yes, you definitely need to deploy both assemblies. Interop.xxx.dll and AxInterop.xxx.dll are runtime callable wrappers (RCW) for a referenced COM and an ActiveX dll