com

How would I make garbage collection clean up RCW objects bound to an out-proc COM server?

我是研究僧i 提交于 2020-01-15 15:30:50
问题 I have a 64-bit .NET process that runs for days. The process consumes a native 32-bit COM server using DCOM. Once in a while the COM server runs out of memory because the .NET process garbage collector only sees the RCWs of the COM objects and those are quite lightweight and "not worth collecting". I need to somehow make garbage collector aware of those COM objects. For the record, I tried to run the same code periodically force-starting garbage collection and the problem goes away so the

Excel COM object - handling workbook close event

感情迁移 提交于 2020-01-15 12:49:06
问题 I am automating an Excel window from a Qt application using QAxObject . I need to get notified when the Excel window is closed by the user. Excel workbook COM object has an event BeforeClose() but handling it is not sufficient because it is fired before user is prompted to save changes, so user would cancel the close operation in save confirmation dialog. So, even BeforeClose() is fired, Excel window may not be closed. There is another event Deactivate() which is fired when a workbook is

How Can i load third party .dll (COM DLL) in ATL Application with WinCE 5.0 RTOS?

為{幸葍}努か 提交于 2020-01-15 11:59:25
问题 I got the answer and need to understand the following : I have a WinCe 5.0 ATL application. This application is using third party COM dll and 3rd party application(.exe).As per my understanding on WinCE and Dll loading is as following: WinCE: All the dll exported functions should be written in ".Def" file and the dll that need to included during runtime image process should be there in ".bib" file.And one should call DLLExport or loadlibrary (i do not want to go into deep how to use these),

Component creation fails under UAC admin, works without UAC elevation

天涯浪子 提交于 2020-01-15 11:42:51
问题 I have a .NET COM dll with a custom registration procedure so it gets registered under HKEY_CURRENT_USER\Software\Classes as opposite to HKEY_LOCAL_MACHINE . So there are the following keys (current user is the admin on the Windows 7 PC): HKEY_CURRENT_USER\Software\Classes\My.ProgId\CLSID HKEY_CURRENT_USER\Software\Classes\CLSID\{XYZZYZYZYZ-YZYZY-ZYZYZY} etc If I build a simple C++ client: hr = CLSIDFromProgID(OLESTR("My.ProgId"), &clsid); and run it without UAC elevation (Windows 7) , it

How do I marshal a stream for COM

瘦欲@ 提交于 2020-01-15 08:31:34
问题 I am consuming a COM object written in Delphi that requires a Stream. The interface generated by VS requests a parameter of type "object" comReader.LoadFromStream(object stream) When I use a FileStream or MemoryStream I get an "Invalid argument"-exception. How do I marshal a stream for COM consummation? 回答1: I think you should create wrapper for .Net Stream that implements COM IStream interface See this article (There is partly implementation) 回答2: Edit I found this interesting answer: How do

How do I marshal a stream for COM

此生再无相见时 提交于 2020-01-15 08:31:26
问题 I am consuming a COM object written in Delphi that requires a Stream. The interface generated by VS requests a parameter of type "object" comReader.LoadFromStream(object stream) When I use a FileStream or MemoryStream I get an "Invalid argument"-exception. How do I marshal a stream for COM consummation? 回答1: I think you should create wrapper for .Net Stream that implements COM IStream interface See this article (There is partly implementation) 回答2: Edit I found this interesting answer: How do

Why is it necessary to add new events to the *end* of an IDL interface?

旧街凉风 提交于 2020-01-15 05:38:40
问题 I have found that when I add new events to an existing COM/IDL interface, I sometimes run into strange issues unless they are added to the end of the interface. For example, say I have the following interface: interface IMyEvents { HRESULT FooCallback( [in] long MyParam1, [in] long MyParam2, [in] long MyParam3); HRESULT BarCallback( [in] long MyParam1, [in] BSTR MyParam2, [in] BSTR MyParam3); }; Now let's say I want to add a new callback event, NewCallback . If I add it like this, I tend not

Advising an HTML control: when should I call DispEventUnadvise?

丶灬走出姿态 提交于 2020-01-15 03:49:27
问题 I use DispEventAdvise in a BHO in order to capture onclick events of a specific checkbox. You can see the code in my previous question (although it's not that relevant). In order to be able to call DispEventUnadvise later, I keep a reference to the IHTMLElement object of the checkbox. When should I call DispEventUnadvise ? Is there a way to know when the checkbox is going away? Is it even legal to keep a reference to the IHTMLElement object? I mean, when the page is destroyed, and there's

Why is my WM_UNICHAR handler never called?

依然范特西╮ 提交于 2020-01-15 03:43:08
问题 I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR: MESSAGE_HANDLER( WM_UNICHAR, OnUniChar ) But, for some reason, the OnUniChar handler is never called. According to the documentation, the handler should first be called with "UNICODE_NOCHAR", on which the handler should return TRUE if you want to receive UTF-32 characters. But, as I said, the handler is never called. Is there anything special that needs to be done to activate this? 回答1: What are

Outlook Com not registered

我与影子孤独终老i 提交于 2020-01-14 19:35:11
问题 Ok so this is a fresh install of windows 8.1 on a new machine in our office. We installed Office Professional Plus 2013 on it and everything looks rosy. However, I get the following error: Everything I've researched says that there's a old outlook value in the registry. 9.3, 9.4 etc. However this computer has never had anything but Outlook 2013 on it and every registry value I can find is 9.5. I am developing an app that pre-writes a standard email we send when we send clients an update. in C