com

AutoHotkey's ComObjActive handle to specific Worksheet

对着背影说爱祢 提交于 2019-12-06 17:04:31
问题 The simplest way to create a handle to your currently active Excel sheets in your .ahk script is: Xl := ComObjActive("Excel.Application") Nonetheless, if one switches to another workbook, this becomes the new " currently active sheet " and AutoHotkey tries to use methods for sheets and cells on the new workbook through COM: of course scripts designed to work with specific sheets and cells don't work anymore on a different workbook. Do you know how to create COM handles to specific workbooks

How do I reliably tell that two Inspector references point to the same inspector instance?

蓝咒 提交于 2019-12-06 16:34:04
[continued from Is there a way to tell whether two COM interface references point at the same instance? ] I've got references to Inspector objects from two different sources and need to be able to tell which item from one source corresponds to which item from the other source. However, none of the approaches I have been able to come up with so far worked (reliably): I couldn't simply compare the IUnknown interfaces as it seems that the Inspectors.Item() method is returning a reference to a created-on-the-fly proxy object rather than the inspector instance itself. Try it: Accessing the same

Unload a COM control when working in VB6 IDE

爷,独闯天下 提交于 2019-12-06 16:32:03
问题 Part of my everyday work is maintaining and extending legacy VB6 applications. A common engine is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough and we rely on COM controls to fire events to VB6. My problem is that when I register the control in VB6, VB loads this control in memory and does not unload it until I quit the VB6 IDE. As the control is loaded the whole time, I am unable to

COM Interop with VB6 and C#

旧时模样 提交于 2019-12-06 16:24:08
I'm writing a C# COM object that will be used by a VB 6 program. That shouldn't be much of a problem, however, the VB6 call to the COM object passes in a VB Control (in this case a TextBox). The program expects the COM object to alter the Text property of the control. Unfortunately, I have to stick to this interface as I'm dealing with someone elses legacy code. How can I set the property for the passed in TextBox? Do I simply create an interface with a Text property and cast input to that interface? Is this even possible? Please let me know if I need to clarify. Note: I intended to leave out

C++ COM Object Hotpatching?

…衆ロ難τιáo~ 提交于 2019-12-06 15:26:41
问题 Background: I'm hooking on windows COM object. The method used is vtable modification. say we have an instance of interface A named instance , it contains oldmethod in the interface, I replaced with newmethod . However, in my newmethod I need to know the address of oldmethod so that I can call oldmethod after doing my own thing. It is not safe to store the address of oldmethod in a global variable, since there might be more than one implementation behind interface A , let's say there are two

New process after CoCreateInstance?

孤街醉人 提交于 2019-12-06 15:26:28
I'm fairly new to COM programming so please excuse if this is a stupid question. After (successfully) creating a COM object using CoCreateInstance or CoCreateInstanceEx with class context CLSCTX_LOCAL_SERVER is there any way to tell if this call caused a new process to be spawned? 来源: https://stackoverflow.com/questions/32165388/new-process-after-cocreateinstance

How to know which COM component is called by a certain PIA?

雨燕双飞 提交于 2019-12-06 15:18:11
I got a PIA installed on my box, it is Microsoft.mshtml . If I understandd it correctly, these PIA is provided by Microsoft to ease our life of COM interop. But I want to know which COM component is actually wrapped/called by this PIA. Because I am having a UnauthorizedAccessException, I want to locate the actual COM component and use dcomcnfg.exe to grant it proper permission. I hope this is the right direction. Thanks! It is c:\windows\system32\mshtml.dll. I seriously doubt that dcomcnfg.exe is going to solve your problem, this is an in-process COM server. You might get more insight by using

TWebBrowser modal print dialog?

心不动则不痛 提交于 2019-12-06 15:13:06
I've found many ways to make the TWebBrowser show a modeless print dialog box, but how do I make it show a modal one? I would like to print an html page, that's why I need the modal dialog. I'd really appreciate your ideas on this one. Thanks! I cannot think of a reason why there would be lots of ways to show a modeless dialog. Why would you want to continue interacting with the web browser while a modeless print dialog is displayed? If you want to initiate the print by program, but need the user to select the printer, use: ExecWB(OLE_CMDID_PRINT, OLECMDEXECOPT_PROMPTUSER); Eureka! I solved it

icon overlay handlers for namespace extension

随声附和 提交于 2019-12-06 14:50:59
I am developing namespace extension which gives a virtual view of files on a server. In this view, I need to provide different states(in use, offline, out of sync, etc) of a file using overlay icons. I was read through article implementing overlay handler, and thought I will try to handle this in one of our overlay handlers, which implement IShellIconOverlayIdentifier interface. I see that IShellIconOverlayIdentifier::IsMemberOf(), and other functions are called only when I access files on normal filesystem, i.e., c:\, d:\ etc. When I browse a namespace extension, these calls are not called at

Can't get package references registered to an instance of Visual Studio 17 and above from Pascal Script

一世执手 提交于 2019-12-06 14:42:46
问题 I need to define whether a specific extension is installed in Visual Studio 2017. I can get package references registered to the instance of VS using Microsoft.VisualStudio.Setup.Configuration.Interop with C#. Here is example of the working code: var query = (ISetupConfiguration2) new SetupConfiguration(); var e = query.EnumInstances(); int fetched; var instances = new ISetupInstance[1]; do { e.Next(1, instances, out fetched); if (fetched <= 0) continue; ISetupInstance2 instance = instances[0