com

What is IconnectionPoint and EventHandling

断了今生、忘了曾经 提交于 2019-12-06 01:55:02
Trying to understand What is IConnectionPoint and how this is connected to IConnectionPointContainer,IEnumConnectionPoints,IEnumConnections and EventHandling . Read the artcicles from MSDN and CodeProject which is explaining a about other methods like: QueryInterface() and otherthings. I am unable to figure out how all these things( IConnectionPointContainer,IEnumConnectionPoints,IEnumConnections ) are interconnected with eachother and event Handling. I just want to create a simpleClient which Will trigger an event in COM object. If there are any articles or code snippet that can explain how

iTunes COM interface on OS/X

邮差的信 提交于 2019-12-06 01:29:24
Is the iTunes COM interface available on Mac OS/X? From the documentation I could find, it seems much more extensive than the Applescript interface I could expose through the Automator program. Disclaimer : absolute OS/X newbie here. The COM interface is windows-only. For seeing what Applescript capabilities an application like iTunes has, you probably want to use the low-level AppleScript Editor utility, instead of Automator . The Open Dictionary... menu command in AppleScript Editor lets you open any scriptable application and see what objects & commands it supports. There's also a large

System.String[*] and System.String[] Difference in C#

梦想与她 提交于 2019-12-06 01:26:45
Edit : I know that C# equivalent of For Each server As String In servers is foreach(var item in servers) but since GetOPCServers returns object, it should be cast to iterable type. I am developing an application using a COM library. Since 64bit causes problems, my target CPU x86. All methods works as expected, except GetOPCServers() . Although Visual Basic code using same dll does not cause problem, C# throws System.InvalidCastException saying that: A first chance exception of type 'System.InvalidCastException' occurred in System.Core.dll Additional information: 'System.String[*]' türündeki

How can C# use a legacy DLL simply without registration(regsvr32)

 ̄綄美尐妖づ 提交于 2019-12-06 01:15:37
问题 Situation I run a build system that executes many builds for many project. To avoid one build impacting another we lock down the build user to only its workspace. Builds run as a non privileged users who only have write ability to the workspace. Challenge During our new build we need to use a legacy 3rdparty DLL that exposes its interface through COM. The dev team wants to register the build(regsrv32.exe) but our build security regime blocks this activity. If we relax the regime then the

How to get an ActiveX component's registered path

自古美人都是妖i 提交于 2019-12-06 01:14:17
I've got a registered ActiveX component which I'm referencing in a C# project. However, I'd like to know the original path to the actual component being run. This is not the execution path per se. Is there something saner than searching the registry by hand? The component is registered with a simple /regserver command, if that's relevant. Andrey Search under the HKEY_CLASSES_ROOT\CLSID with the name of your EXE file. It should be used as value of "LocalServer32". Here's a function that fetches the value out of the Registry. Extra validation required. using Microsoft.Win32; //... static string

How to debug a COM C++ Out of Process Server ? (client: Excel vba)

我是研究僧i 提交于 2019-12-06 00:31:18
I don't know how to debug a COM ATL C++ out of process exe server with Visual Studio 2015. For a COM ATL DLL there is no problem, the breakpoints are automatically triggered when I call the COM dll. However when I try to debug an EXE server, the debugger didn't break. Indeed the exe server is only loaded at demand and the debug symbols of the exe server are not loaded when the client starts. My client, that call the COM server, is Excel VBA (I have added the reference to the com exe, in the VBA editor, via Tools/References). To debug it, I set the path to Excel.exe in the Visual Studio Debug

Implementing IDispatch in c#

守給你的承諾、 提交于 2019-12-06 00:22:47
问题 I'm writing some test code to emulate unmanaged code calling my c# implementation of a late binding COM object. I have an interface that is declared as an IDispatch type as below. [Guid("2D570F11-4BD8-40e7-BF14-38772063AAF0")] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface TestInterface { int Test(); } [ClassInterface(ClassInterfaceType.AutoDual)] public class TestImpl : TestInterface { ... } When I use the code below to call IDispatch's GetIDsOfNames function .. //code

How to make stdcall from Go

旧街凉风 提交于 2019-12-06 00:06:25
I have a pointer to a COM interface and would like to take the function pointers from its virtual table and make method calls. To do this I need to make stdcall method calls. In Go how do I make a call with convention stdcall or make a call with convention stdcall in cgo? See "godoc syscall Proc" for instructions on how to call stdcall functions on windows. Be warned that *Proc.Call does allocate / deallocate memory, so, if you care about efficiency, you should use correspondent syscall.Syscall/syscall.Syscall6/syscall.Syscall9/... function instead. Alex 来源: https://stackoverflow.com/questions

How to clean up COM references in .NET when app will be left running?

我与影子孤独终老i 提交于 2019-12-05 23:55:02
I am working on a .NET program that starts a new instance of Excel, does some work, then ends, but must leave Excel running. Later, when the program runs again, it will attempt to hook into the previous instance. What is the best way to handle the releasing of COM objects in this situation? If I do not do a "ReleaseComObject" on the app object the first time, then on the second run get the active object, then finally release the com object, do I have a memory leak? The following simplified code illustrates what I am trying to do: private Microsoft.Office.Interop.Excel.Application xlsApp;

How to obtain the PIDL of an IShellFolder

三世轮回 提交于 2019-12-05 23:33:21
问题 If I have an IShellFolder interface pointer. How might I obtain its PIDL? I can see how to enumerate its children, and I can see how to use it to compare any two children. But how might I get its own pidl? I ask because I'd like to know: Is this IShellFolder == Another IShellFolder I can use IShellFolder::CompareIDs() , but I have to have the IDs of both folders. 回答1: What either Chris or Mordechai writes on #1 is anyway not to the point. The question is not about objects in the shell