com

Select IE window using HWND

不羁岁月 提交于 2019-12-10 12:35:00
问题 Wondering if it is possible to select an IE window based on the HWND property (or similar). My script clicks a link which opens a new page in a separate window and I would like to be able to work with this new window. Here is my code: $ie.Navigate("https://chaseloanmanager.chase.com/Chaselock/ViewOnlineGuide.aspx") # opens page in new window while ($ie.Busy -eq $true){Start-Sleep -Seconds 2} $childWindow = Get-Process | Where-Object {($_.ProcessName -eq 'iexplore')} | Get-ChildWindow | Where

How to initialize a constant CLSID

删除回忆录丶 提交于 2019-12-10 12:34:43
问题 A class ID (GUID) is generally specified with a sequence of hex numbers separated by dashes, e.g. {557cf406-1a04-11d3-9a73-0000f81ef32e} . This is not a literal that can be used to initialize a CLSID structure directly. I've discovered two ways to initialize the structure, but they're both kind of awkward. The first doesn't allow it to be declared const and must be done at run time, while the second requires extensive reformatting of the hex constants. CLSID clsid1; CLSIDFromString(CComBSTR("

How to provide a private Side by Side manifest that correctly locates a .NET Dll as COM Provider?

*爱你&永不变心* 提交于 2019-12-10 12:29:25
问题 I'm researching about the configuration of a private registration free WinSxS with the plain provision of assembly manifest files, to stitch Delphi executables (COM clients) and .NET (C#) COM visible DLLs together at deployment and runtime. I already studied the documentation available at MSDN "Interoperating with Unmanaged Code", the sections about "COM Callable Wrapper" and "How to: Configure .NET Framework-Based COM Components for Registration-Free Activation" in particular. After even

C# COM and attaching events

情到浓时终转凉″ 提交于 2019-12-10 12:24:51
问题 So, I have this legacy type app I am trying to understand and maintain and need some help. I have not dabbled much into Remoting but this solution appears to be using 3rd party COM components. The documentation is reasonable but does not talk much about .NET and how to attach event handlers. Instead it documents (and is used in the solution) about how to create an instance of the object via Activator.CreateInstance. so currently it is doing this: mainObj = Activator.CreateInstance(Type

C++ - Running Windows Media Player from Console Application - COM

北战南征 提交于 2019-12-10 12:18:16
问题 I am trying to play a movie using Windows Media Player, later on will add some other functionality. Following is the code I have written: const CLSID CLSID_WindowsMediaPlayer = {0x6BF52A52, 0x394A, 0x11d3, {0xB1, 0x53, 0x00, 0xC0, 0x4F, 0x79, 0xFA, 0xA6 } }; HRESULT hr; IWMPPlayer *pMediaPlayer = NULL; hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if(FAILED(hr)) { std::cout << "ERR -- Could not Initialize COM engine for you" << std::endl; return 0; } hr = CoCreateInstance(CLSID

Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application)

可紊 提交于 2019-12-10 12:04:33
问题 I just installed Visual Studio 6 (SP5) on a Vista Enterprise machine. Had some problems but I think it’s set up alright. The problem is my VC++ 6 application fails when trying to host an ActiveX. I was able to compile it ok, though got a warning message from Vista about the rc.exe (“This program has known compatibility issues” ). When I debugged it I saw that my class that derives from CAxDialogImpl fails on its Create() method. The same application worked just fine on XP! Is there a known

EIntfCastError 'Interface not supported' when run as a TServiceApplication

人走茶凉 提交于 2019-12-10 11:53:08
问题 I'm having problems using a COM-object when I run my application as a Windoes Service, i.e. TServiceApplication. The exception EIntfCastError 'Interface not supported' is raised. If I run the application as a normal Delphi app then it works fine, including if I run as a service using srvany.exe type IMyInter = interface (IUnknown) ['{9E6B311E-C6D3-4687-B272-3FBE9DBC2DD6}'] //... end; type TMyObject = class private FMyInter: IMyInter; published constructor Create(const ClassID: TGUID); end;

How to force process isolation for an out of process COM server?

二次信任 提交于 2019-12-10 11:49:57
问题 I'm writing managed code that has to interact with a vendor's COM automation server that runs out of process. I have found that this server becomes unstable if more than one client connects to it. For example, if I have managed code in process A and managed code in process B both connecting to this COM server, a single process will be spun up for the COM server and it's behavior is less than reliable. I'm hoping there's a way to force a separate process for each client - server connection .

IGraphBuilder::RenderFile() failing with VFW_E_BAD_KEY - 0x800403f2

…衆ロ難τιáo~ 提交于 2019-12-10 11:45:53
问题 Continuing investigation on a embedded WindowsMediaPlayer problem, i am trying to do simple file playback via a DirectShow in-process server: ::CoInitializeEx(0, COINIT_MULTITHREADED); CComPtr<IGraphBuilder> spGraph; spGraph.CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER); CComQIPtr<IMediaControl> spMediaControl(spGraph); // ... later: spGraph->RenderFile(L"c:\\foo.wav", 0); // fails with VFW_E_BAD_KEY spMediaControl->Run(); Interestingly, this runs fine on both systems i tested

Discovering registered COM components

99封情书 提交于 2019-12-10 11:33:50
问题 Is there a way to determine if a registered COM component is creatable as a stand-alone component simply by parsing the information available in the registry? In particular, by the information found in HKCR/ClsId? My system has over 12,000 entries in this key, and I am already excluding any items that do not have an InProcServer32 or LocalServer32 key, but this only eliminates about half of the items. I believe there are still another couple thousand that are not creatable objects. I really