com

Getting a slice of idle processing in managed component under unmanaged host

筅森魡賤 提交于 2019-12-10 09:23:31
问题 I have a managed component written in C#, which is hosted by a legacy Win32 app as an ActiveX control. Inside my component, I need to be able to get what normally would be Application.Idle event, i.e. obtain a time slice of the idle processing time on the UI thread (it has to be the main UI thread). However in this hosted scenario, Application.Idle doesn't get fired, because there is no managed message loop (i.e., no Application.Run ). Sadly, the host also doesn't implement

DocumentComplete event in Embedded IWebBrowser2 using write() method

不问归期 提交于 2019-12-10 08:31:27
问题 I've been looking hard for this but still have not found any solution. I'm using native win32 c++ (no MFC, ATL or .NET) I'm loading an html document with IHTMLDocument2->write(). I would like to get the event when the page is ready to show, meaning that all images and elements are downloaded and rendered. Following the embedded browser object from here embedded web control (IWebBrowser2), embedded javascript's onkeydown and onkeyup not firing and from here http://www.codeproject.com/Articles

How to use win32com to handle overflow when querying Desktop Search?

◇◆丶佛笑我妖孽 提交于 2019-12-10 06:49:48
问题 I'm querying the Windows Desktop Search JET (ESE) database using Python + ADO. It works but after ~7600 records I get an exception when advancing to the next record using MoveNext . I know it is not at EOF because I can run the same query in VBScript and get way more records with the same query. Exception traceback Traceback (most recent call last): File "test_desktop_search.py", line 60, in <module> record_set.MoveNext() File "<COMObject ADODB.Recordset>", line 2, in MoveNext pywintypes.com

Connecting to WMI: 0x800706ba errors on some machines (but not all)

余生颓废 提交于 2019-12-10 06:42:38
问题 When I try to connect to WMI from Powershell, ConfigMgr, or WMI explorer, I can talk to the majority of my computers, but some (maybe 30%?) return an 0x800706ba (RPC server is unavailable). If I turn the firewall off on the remote machine, the queries start working. I have tried a bunch of different configurations of firewall settings, though, and I can't seem to figure out what the right combination of exceptions is. Here's the relevant bits of my firewall config on the remote machine. The

How to get the System.Type of a Runtime Callable Wrapper class from its CLSID?

纵然是瞬间 提交于 2019-12-10 06:21:26
问题 Note: For background information please see this related question: How to get LINQPad to Dump() System.__ComObject references? I am able to retrieve the CLSID of the RCW class corresponding to a COM object (obtained from another COM object, not initialized by my code) using IPersist.GetClassID(). Type.GetTypeFromCLSID() always returns the weakly-typed System.__ComObject , not the strongly-typed RCW class. I need to get the System.Type of the strongly-typed RCW class to be able to wrap the COM

How to access an indexed property on a COM object from Powershell

你。 提交于 2019-12-10 04:13:27
问题 I'm using Powershell to talk to the Windows 7 task scheduler service via COM through the Task Scheduler 2.0 interfaces (e.g. ITaskDefinition). I want to pull out a particular trigger from the Triggers collection on ITaskDefinition. It appears that the proper way to extract a particular trigger is through the Item property, which is an indexed property. My first try looks something like this: $sched = New-Object -Com "Schedule.Service" $sched.Connect() $folder = $sched.GetFolder('\') $task =

Why don't COM object use IDisposable?

浪子不回头ぞ 提交于 2019-12-10 04:03:13
问题 Why don't COM object use IDisposable in their CLR Callable Wrappers? 回答1: Presumably such an IDisposable implementation would call Marshal.ReleaseComObject. There are cases where calling Marshal.ReleaseComObject is a good idea, for example to get an Office application to quit after automation from a .NET client. But as the documentation for Marshal.ReleaseComObject states, it should not be used in the general case - and probably not at all for in-proc COM objects. Here's a blog post with some

How does .NET/COM work with multiple versions registered via Regasm?

大城市里の小女人 提交于 2019-12-10 03:56:09
问题 I have a .NET DLL (that happens to be written in C++/CLI). Parts of it I want to expose via COM. I do this and register it using "regasm my.dll /codebase". So far so good. But then I change some things and the version number of the assembly changes plus I move the dll to a different folder. I register it again and look at my COM object in OLE/COM Viewer. I see something like this InprocServer32 [Codebase] = file://c://foo/bar/my.dll 7.0.0.0 [Class] = My.Blah.Class 7.0.0.0 [Assembly] = Sync,

GetObject and VB6 ActiveX exe

こ雲淡風輕ζ 提交于 2019-12-10 03:48:58
问题 The VB6 help on GetObject says "You can't use GetObject to obtain a reference to a class created with Visual Basic" (the very last sentence!). My VB6 GUI exposes objects as an ActiveX exe, for other components to manipulate. I want the other components to connect to the GUI that's already running, rather than start a new instance of the exe. I've found using GetObject does work, if you use this syntax: Set myobj = GetObject("", "ProjectName.ClassName") It worries me that the help says this

Python instrument drivers

╄→гoц情女王★ 提交于 2019-12-10 02:44:53
问题 I am an experimental physicist and am a big enthusiast of Python. I find it great for data analysis and scripting, and I actualy also use it to interface laboratory instruments (network analyzer, scopes, signal analyzers, and signal generators...). I think Python would be a very serious competitor for MATLAB in my field if there would exist a nice library incorporating instrument drivers. Up to now, I have been using several strategies to interface them directly from my IPython session: Using