com

How can I use a VB6 COM 'reference' in IronPython?

我们两清 提交于 2019-12-24 00:28:48
问题 I'm currently developing what is more or less a script that needs to get some data from a VB 6 COM dll. This dll is currently used in a MS Word VBA project, and it exports classes, etc to the VBA code. It is added in the Tools -> References menu in the VBA editor, and I can see it's classes in the object browser of VBA. From my readings, it is possible to use a VB6 COM library in VB.NET (or at least, it is supposed to be able to.) As it should be possible in VB.NET, and since .NET runs on the

Writing the correct IDisposable implementation for classes with COM objects

回眸只為那壹抹淺笑 提交于 2019-12-23 23:33:38
问题 I have a class that uses a .NET wrapper for a COM object and well it is giving me that infamous RCW error, so in my investigation I found that if I take out the Dispose() method from the finalizer of this class it will fix the RCW error so something is wrong for example the object is getting disposed but the registered events are still hanging around ... But just removing the Dispose() can't be the answer because then who is going to release the memory ? ( I ran a Memory profiler and

Modern .NET equivalent for COM interop

孤者浪人 提交于 2019-12-23 23:08:54
问题 What is the modern day equivalent to achieve COM interop type of integration (i.e. for Excel type of automation purposes) between two .NET applications? For example, if you expose a .NET application API via COM, you are able to get a runtime reference to that application in your COM client and get event callbacks, call methods, etc. Is there a modern day technology suited for this between two .NET applications? I understand there is .NET Remoting or WCF (i.e. via named pipes) - is there

C# COM Objects and Multithreading

给你一囗甜甜゛ 提交于 2019-12-23 22:11:40
问题 i am currently developing an windows form application, which communicates with a serial device. The vendor of the device offers a *.dll file including methods for interacting. I added a reference to *.dll file in visual studio. If i call a function of device library (Get()), i get a response after 2 seconds. To avoid freezing my GUI, i spawn a new thread, which initializes a new instance of the library object and calls the Get()-Method. However, calling Get() freezes my GUI for exactly 2

C# COM object with a dynamic interface

*爱你&永不变心* 提交于 2019-12-23 21:47:10
问题 I'd like to build a COM visible C# class, say DynamicComponent , that would provide a dynamic interface through COM. Internally this class would maintain a dictionary of delegates: "GetTheAnswer" -> () => { return 42; } "Add" -> (int a, int b) => { return a + b; } ... The client code would be some VBA. Here is the workflow I naively imagine: from the Excel/VBA editor the user references the TLB the user instantiates a new DynamicComponent (well at least get a stub provided by Excel/VBA) Excel

How do I restart a COM+ application on a remote server from .NET?

寵の児 提交于 2019-12-23 19:58:04
问题 How do I programmatically restart a COM+ application running on a remote server from code in .NET? 回答1: You have to use the ComAdmin API through COM interop. Put a reference on Windows\System32\Com\ComAdmin.dll, then: COMAdmin.COMAdminCatalog catalog = new COMAdmin.COMAdminCatalogClass(); catalog.Connect(servername); catalog.ShutdownApplication(AppNameOrAppID); You can find the ComAdmin reference in MSDN here. It's a COM API, and kind of wierd. Eg. you cannot instantiate a COMAdminCatalog,

_IDTExtensibility2, what DLL to import into ATL project?

不问归期 提交于 2019-12-23 19:27:20
问题 So I'm trying to solve my Office add-in task again; I have created the ATL project, added simple class, and now want to add interface implementation, as http://www.devarticles.com/c/a/Cplusplus/Writing-an-MS-Word-Addin/1/ proposes; However, available type libraries list has no listed Extensibility to add; I checked under Program Files, but the Extensibility.dll found there was a .NET assembly without exposed COM classes. 回答1: Type library is {AC0714F2-3D04-11D1-AE7D-00A0C90F26F4} , named

Catch audio sessions events

岁酱吖の 提交于 2019-12-23 18:28:22
问题 I try to write some application that will monitor audio sessions (like SndVol does). I activated IAudioSessionManager2, got list of current audio sessions through IAudioSessionEnumerator, registered for the notification using RegisterSessionNotification method in audio session manager. However, my application never receives notification OnSessionCreated(). Of course, I read the similar topics here: Notifications not sent, IAudioSessionNotification anyone have working code I read carefully all

Get the DLL-file for a COM-Object without using CLSID and registry in c++

一世执手 提交于 2019-12-23 18:14:51
问题 Is it possible to get the DLL-filename for a loaded COM-Object without using the CLSID and a registry lookup? I have an IUnknown or in my case an IBaseFilter interface pointer and now I want to get the DLL-filename who created this COM-Object. Can I use the object point adress to reverse lookup the loaded module where it was created? And then get the HMODULE to use it in GetModuleFileName . 回答1: Only using some hacks, naturally. The object itself is on the heap, which is shared, but you could

How to prevent coclass implementations from being exposed in an ATL type library

别来无恙 提交于 2019-12-23 18:04:04
问题 I am building an ATL type library with a type of class factory. Something sorta like this: [ object, uuid(...), ... ] interface INumber : IDispatch { [propget, id(0)] HRESULT Value([out, retval] LONG* pVal); } [ object, uuid(...), ... ] interface INumberFactory : IDispatch { [id(1)] HRESULT GetNumber([in] BSTR numberName, [out, retval] INumber* pVal); } [ uuid(...) ] coclass NumberFactory { [default] interface INumberFactory; } The user can then get an instance of a class that implements the