com

HowTo: Display progress dialog using IFileOperation

本小妞迷上赌 提交于 2019-12-08 03:30:31
I’m trying to get a progress dialog to display for my copy operation in some sample code. I’m using IFileOperation because I found that using SHFileOperation will not display a progress dialog if the files have already been copied to the target location. My hope is that IFileOperation is a little more sophisticated and can handle that situation. Here’s the sample code I’ve tried…. CComPtr<IOperationsProgressDialog> opProgressDlg; HRESULT hr = opProgressDlg.CoCreateInstance(CLSID_ProgressDialog); CComPtr<IFileOperation> fileOp; hr = fileOp.CoCreateInstance(CLSID_FileOperation); hr = fileOp-

Is possible having two COM STA instances of the same component?

六眼飞鱼酱① 提交于 2019-12-08 03:14:25
I had a problem discovered on another thread here , I need to access a COM component that is STA. I'll run it on a dual-core computer, a process using this component only reaches 50% of CPU. Unfortunately, the owners said they can't change the component to MTA, because the component is a hybrid system compiled at Matlab, which core is C. So I tried to load two instances of the COM class on the same process, different threads accessing it, but I couldn't, only the last COM instance becomes usable. Do you know anything that could solve this problem? I am considering running two processes of my

How do i set Identity of COM+ server type application to Network Service in power shell

北城以北 提交于 2019-12-08 02:39:41
问题 I need to do the following thing. Create com+ application -> set activation type to Server type-> set identity as Network service->Add user group under creater owner. I am able to set activation type,but i am not able to set identity and the further steps. I am new to com+ applications. the script i have written is as follows $comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog $apps = $comAdmin.GetCollection(“Applications”) $apps.Populate(); $newComPackageName = “test7”

How to call release from COM server

三世轮回 提交于 2019-12-08 02:32:25
问题 I am writing a Com server and I have wrote code that detect situation when COM client was closed unexpectedly, in this case I should close COM server inside COM server code. How can I do this? UPD: I have situations when COM server is hanged or more correctly I can't attach to COM server from COM client, but application that contains COM server is alive, so I think that COM server can detect that all old COM clients was disconnected/closed/crashed and application will restart because no new

Is there a working example of COM event handling in C++ Builder?

狂风中的少年 提交于 2019-12-08 02:28:36
问题 I am trying to connect a C++ Builder app with a .NET service app, and would like the .NET service app to be able to send events back to the C++ Builder app. Is there a working example of a C++ Builder app which can handle COM events? 回答1: There was an error in the DocWiki regarding handling COM Events. I was able to collect some examples from various places, and put them together here for reference. The .NET application has the following: using System; using System.IO; using System.Runtime

Registering a dll on 64 bit Windows Server 2008 Standard SP2 IIS 7

可紊 提交于 2019-12-08 02:23:32
问题 Project: VS2010 C# Class Library. Local machine: Win 7 64bit Following items changed in the project: Properties/AssemblyInfo.cs [assembly: ComVisible(true)] Project/Properties/Build tab: Register Com for Interop: checked Generate Seralization assembly: auto I have setup the test classes per following post with interfaces, comvisible=true and guids etc: Building a COM interop library for ASP Classic using 4.0 framework and Visual Studio 2010 I was able to register this dll on my local machine

Handling an OnClick event of a checkbox

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:22:07
问题 I'm trying to handle click events of a checkbox control from a BHO. Here is my code: void STDMETHODCALLTYPE CMyBHO::OnDocumentComplete(IDispatch *pDisp, VARIANT *pvarURL) { // ... InitPage(pDocument); } void CMyBHO::InitPage(IHTMLDocument2 *pDocument) { CComQIPtr<IHTMLDocument3> document3 = pDocument; CComPtr<IHTMLElement> elementCheckbox; document3->getElementById(CComBSTR(L"checkbox_id_here"), &elementCheckbox); if(!elementCheckbox) return; if(!m_fCheckboxAdvised) { // Register to sink

DocumentComplete is firing before page is fully loaded

感情迁移 提交于 2019-12-08 02:01:37
问题 Why does DocumentComplete event of WebBrowser COM object fire before page is loaded? I thought that this event is only fired when page is fully rendered in browser's window. this is my BHO implementation: [ComVisible(true), Guid("5a954357-44bd-4660-9570-17bb1b71eeaa"), ClassInterface(ClassInterfaceType.None)] public class BHO : IObjectWithSite { private WebBrowser browser; private DateTime startTime; private DateTime endTime; private object _pUnkSite; public void OnDocumentComplete(object

Need to remove an Object from DCOM config (DCOMCNFG)

核能气质少年 提交于 2019-12-08 01:41:01
问题 We have an application with activex exe and a com dll. After installing we get an object created in DCOM config. If we try to delete this object from DCOM config, it goes off till we again reopen it. Want to know if there's any procedure to delete this object completely from DCOM and its registries. 回答1: No idea why this would be tagged VB.Net, but... You can remove most of the server's registration entries by running the EXE with a command line switch as in: MyAx.EXE /unregserver However

Calling function from 64bit app from a 32bit dll

混江龙づ霸主 提交于 2019-12-08 01:31:29
I have a 32bit dll (no source code) that I need to access from 64bit C# application. I've read this article and took a look into the corresponding code from here . I've also read this post. I'm not sure that I'm asking the right question, so please help me. There are 3 projects: dotnetclient , x86Library and x86x64 . The x86x64 has x86LibraryProxy.cpp which loads the x86library.dll and calls the GetTemperature function: STDMETHODIMP Cx86LibraryProxy::GetTemperature(ULONG sensorId, FLOAT* temperature) { *temperature = -1; typedef float (__cdecl *PGETTEMPERATURE)(int); PGETTEMPERATURE pFunc;