com

Is there a way to watch all COM activity on a computer?

巧了我就是萌 提交于 2019-12-05 17:53:12
I'm trying to deal with a piece of specialized hardware, that presents it's interface as a COM object, using win32com in Python. However, the documentation for how to actually set up the hardware through the COM object is sparse (it requires a significant amount of initialization), and entirely oriented at using a bunch of pre-built libraries for Visual Studio, which are not accessible through python. That said, is there any way to watch all local COM activity, so I can sort through the activity logs to try and figure out how the existing demo programs properly initialize the hardware, and

Iterating over Word Document Fields using ComAutomationFactory in Silverlight 4

一世执手 提交于 2019-12-05 17:24:12
Update : This is a confirmed bug in Silverlight 4 beta. http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=523052 I solved this issue by switching to a full blown WPF application and using regular old Microsoft.Office.Interop.Word. But I'm still very interested in how to get this to work using the dynamic values from ComAutomationFactory. This may be more of a C# 4.0 question, but what I'm trying to do is leverage the ComAutomationFactory class in a trusted SL4 app to load up a Word doc, change some text, and print it. Using a regular windows app, it's pretty easy:

Is it possible call a COM object from within R, if the COM object is exposed from a .NET assembly?

若如初见. 提交于 2019-12-05 17:15:18
I'm wondering if it is possible to call .NET functions from R, via a COM call. The library rcom allows calls to COM objects, so this should be possible, in theory, for any .NET assembly that is exposed as a COM object. To keep it simple, I'll see if I can call the .Reverse() function in System.Text , which is exposed by default as a COM object from the .NET framework. This is what I have tried so far: I obtained a list of ProgID's in my system (see link to C# code ). Here is a list of the relevant ProgIDs in my system: ---start list of COM ProgID entries--- <snip> System.SystemException ->

Debugging .Net4 COM registered assembly from Win32 caller in Visual Studio 2010

痴心易碎 提交于 2019-12-05 17:13:39
This is a very simple setup, I can't believe but I didn't find anybody with the same problem so far... Create a .Net4 class library in VS2010. Create a simplest possible COM object: [ComVisible(true)] [Guid("CD157EBC-C89D-40b6-B531-E85FF4B3AE9A")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAcorn { bool Foo(string moo); } [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] [Guid("854B7690-C1C4-40c4-8059-B4F3450B30D0")] public class Acorn : IAcorn { public Acorn() { } public bool Foo(string moo) { return true; } } Set "Register for COM interop" option for

Make my COM assembly call asynchronous

99封情书 提交于 2019-12-05 17:03:09
问题 I've just "earned" the privilege to maintain a legacy library coded in C# at my current work. This dll: Exposes methods for a big legacy system made with Uniface, that has no choice but calling COM objects. Serves as a link between this legacy system, and another system's API. Uses WinForm for its UI in some cases. More visually, as I understand the components : *[Big legacy system in Uniface]* ==[COM]==> [C# Library] ==[Managed API]==> *[Big EDM Management System]* The question is: One of

PHP Component Object Model “Access is denied”

天大地大妈咪最大 提交于 2019-12-05 16:30:16
问题 My development environment is PHP 5.3, IIS 7.5, and Window7 Home. I am developing a prototype application, which requires the PHP function imagewindowgrab(). This function requires calling the Windows Component Object Model (COM). My single line of code was this: $browser = new COM("InternetExplorer.Application") or die("Unable to instantiate IE"); It produced the following error: Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `InternetExplorer

How does one return a local CComSafeArray to a LPSAFEARRAY output parameter?

本秂侑毒 提交于 2019-12-05 16:07:55
问题 I have a COM function that should return a SafeArray via a LPSAFEARRAY* out parameter. The function creates the SafeArray using ATL's CComSafeArray template class. My naive implementation uses CComSafeArray<T>::Detach() in order to move ownership from the local variable to the output parameter: void foo(LPSAFEARRAY* psa) { CComSafeArray<VARIANT> ret; ret.Add(CComVariant(42)); *psa = ret.Detach(); } int main() { CComSafeArray<VARIANT> sa; foo(sa.GetSafeArrayPtr()); std::cout << sa[0].lVal <<

Powershell: Using jQuery through InternetExplorer.Application

≡放荡痞女 提交于 2019-12-05 15:55:02
I followed this article , explaining how to spice up an Internet Explorer COM-Object with jQuery. While the author used Python, I want to do something similar in Powershell. Right now I have this code: function addJQuery ($browser) { $url="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" $document = $browser.document $window = $document.parentWindow $head = @($document.getElementsByTagName("head"))[0] $script = $document.createElement("script") $script.type = "text/javascript" $script.src = $url $head.appendChild($script) while (!$window.jQuery) { sleep -milliseconds 100 }

Not getting event arguments in IHTMLElement event handler

匆匆过客 提交于 2019-12-05 15:34:47
I've added a callback to an IHTMLElement instance but when the IDispatch::Invoke is called for the event, there are never any arguments (i.e. the pDispParams->cArgs and pDispParams->cNamedArgs are always 0). For example, I add a callback for an onmouseup event. From what I can tell, a callback for this event is supposed to receive a MouseEvent object. Is that correct? If so, what do I need to do to ensure this happens? This is using the MSHTML for IE 6 sp2 (or better) on Windows XP SP2. Events arguments for all DOM events including onmouseup are stored in the parent window's event property (

WatiN “Unable to cast COM object” exception

血红的双手。 提交于 2019-12-05 15:34:14
from time to time, my monitoring application dies for no obvious reason. It seems like "mshtml.HTMLDocument" resource isn't available. Anyone else experienced something similar? Thanks in advance. Error message: 14.04.2011 18:26:37 -> Test 1.2 (Subscriber type requests), error: Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F55F-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from