com

How can I use requests with Ironpython?

让人想犯罪 __ 提交于 2019-12-11 12:48:05
问题 I'm trying to run a script that was written with python 2.7, using some libraries that I've installed on my Windows machine - among them numpy scipy, scikit, requests and others. Now I need to use a COM object dll, so I am writing an IronPython script that loads that dll. However when I try to use or import the python 2.7 code, I get import errors: ImportError: No module named requests How can I use that python 2.7 code I wrote with IronPython? I could run the script with the python 2.7

Convert COM object to .Net Object

最后都变了- 提交于 2019-12-11 12:34:37
问题 public int Set(int newValue,Object obj) { //System.Windows.Forms.Control ctrl = (System.Windows.FormsControl)Object; } The Object here is COM object. Now I want to convert it to a .NET object and get hold of its properties. What is the easiest way to do it? 回答1: You can't convert a COM object into a Windows.Forms.Control object directly. It isn't that specific type. The COM object should, if you use the correct type library, provide you with properties of its own. You should be able to use

How does one call into COM from worker thread created with NT's QueueUserWorkItem?

末鹿安然 提交于 2019-12-11 12:25:54
问题 I've got a set of tasks that I slaved to the NT threadpool using QueueUserWorkItem . I need to make some calls to COM from these separate threads to access data inside WMI. I'm unsure, however, how the correct calls to CoInitializeEx need to be made. Basically, the CoInitializeEx docs say that the call should be made once per thread. But I don't own these threads—NT does. I don't know when they get created or destroyed, or anything of that nature. Do I basically call ::CoInitializeEx() (with

Returned managed object method not called from C++ in COM interop

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:47:36
问题 This is a follow up from my previous post. Read that post for context. Note that it is not strict COM interop - but the C++ interfaces are COM compatible. Im trying to implement this C++ interface in C# class IPluginFactory : public FUnknown { virtual tresult PLUGIN_API createInstance (FIDString cid, FIDString iid, void** obj) = 0; }; My C# code looks like this: [ComImport] [Guid(Interfaces.IPluginFactory)] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IPluginFactory

COM Interface as a param of WinRT ref class, how it possible?

爱⌒轻易说出口 提交于 2019-12-11 11:26:09
问题 How I can define this class correctly: public ref class WICBMP sealed { void Load(IWICBitmapSource ^wicBitmapSource); }; 回答1: This is not possible. Only Windows Runtime types may be used when declaring members of a Windows Runtime interface (in this specific case, the compiler will need to generate an interface that declares your Load member function). You can't even do this if you try to define the interface in IDL. A runtime class can implement COM interfaces that are not Windows Runtime

How can the caller's process be identified in an ATL COM+ out-of-proc server application?

荒凉一梦 提交于 2019-12-11 11:14:38
问题 I have an ATL service running as an out-of-proc server that has several COM classes that the clients are expected to be using. Because of a change in requirements, I need to be able to identify which process owns which instances of the objects. I'm trying to use some of the COM functions to find out this information but I can't find the right ones. CoGetCallContext only returns information about the user who called the method, not which process it came from. Same with CoQueryClientBlanket .

Detect when a COM Object goes out of Scope

心不动则不痛 提交于 2019-12-11 10:57:44
问题 I have a .NET Component that is being exposed to COM. This component has a thread running internally that connects to a named pipe, and handles disconnects from the pipe and reconnects as needed. The thread runs for the lifetime of the instance of the component that was instantiated inside the COM Program (vb6 in this instance). If the COM application is shutting down, but not calling my "Close" method that gracefully shuts down the thread (and pipe), is there a way to detect that they are

Calling Inherited IUnknown::Release() in a destructor

拥有回忆 提交于 2019-12-11 10:49:06
问题 Why does calling the inherited IUnknown::Release() function on a IWICImagingFactory object in a destructor cause a "CXX0030: Error: expression cannot be evaluated" to be shown each entry in the object's virtual function table (__vfptr)? This is in reference to an earlier question I posted but I've since realized that the problem only occurs in the destructor. The virtual function table appears valid anywhere else I have checked. However, once in the destructor all entries are shown with the

“new VpnApiClass()” get COM Exception 800701e7 till reboot

房东的猫 提交于 2019-12-11 10:24:45
问题 I am using the CISCO COM object accessed via Interop.VpnApiLib in a C#, .NET2.0 project on Windows 8.1, 64 bit. I create an instance of the class VpnApiClass from this library with the following line: vpnApiLib = new VpnApiClass(); Sometimes this line of code works, but too often, I get the following Exception: Retrieving the COM class factory for component with CLSID {C15C0F4F-DDFB-4591-AD53-C9A71C9C15C0} failed due to the following error: 800701e7. Only a Windows reboot helps in such a

Windows COM - how to debug a COM server

假如想象 提交于 2019-12-11 10:15:42
问题 I have a com server(written in C++, ATL) that runs out of process. In one of my computers I am able to debug the server code easily just by starting the COM under the debugger, setting breakpoints and connection to the server from a client process. On my another computer this does not happen, if I start the COM server under the debugger from start, the client uses another instance of the same server and the only way to debug the server is to attch to it after the client already started it.