com

How do I resolve process hanging on CoUnitialize()?

久未见 提交于 2019-12-13 13:31:45
问题 I have a native Visual C++ NT service. When the service is started its thread calls CoInitialize() which attaches the thread to an STA - the service thread uses MSXML through COM interfaces. When the service receives SERVICE_CONTROL_STOP it posts a message in the message queue, then later that message is retrieved and the OnStop() handler is invoked. The handler cleans up stuff and calls CoUnitialize() . Most of the time it works allright, but once in a while the latter call hangs. I can't

Creating COM using ATL in C++ from VS2012

丶灬走出姿态 提交于 2019-12-13 13:25:58
问题 Trying to create simple COM library using ATL in Visual Studio 2012. I do: New ATL Project Welcome to the ATL Project Wizard Next Application Settings - no change (DLL) Next Finish Got a lot of files: Trying to understand where to add simple function that can be called by COM user. I found only one place where I can add function using wizard: But I see that something is missing there regarding parameters selection like in,out,retval. And I was hoping that after adding new function at least

Connecting to a COM interface in an aspx code-behind running on IIS?

a 夏天 提交于 2019-12-13 13:13:49
问题 I've created a Windows service (an exe based on the Visual Studio ATL wizard) which exposes a COM interface. No problems running as an in-proc server or a Windows service. I need a Windows service since I need some processes to be available outside of IIS access. I've been creating some web pages (aspx/C#) calling my service and everything has worked fine testing within the Visual Studio .NET Development Server. Now, I'm trying to push the web pages to IIS 7 (running on windows 7) for further

What is the best way to detect if a COM component is installed

[亡魂溺海] 提交于 2019-12-13 12:34:54
问题 I have a COM interop assembly, and I would like to check from a .NET application whether the component I'm about to create is installed on the machine. I would like to provide a nice error message if it is not installed. Put the instantiation into try-catch is not a good solution for me, as I would like to distingwish between the missing installation and the other errors that may occur. My idea is to check whether the node with the COM class id exists in the registry under the HKEY_LOCAL

VB.NET/COM Server code way slower than Excel VBA code

Deadly 提交于 2019-12-13 12:23:56
问题 Background I have a client who needs Excel VBA code that produces formula values moved to VB.NET. He is in the business of providing financial analytics, in this case delivered as an Excel add-in. I have translated the VBA into VB.NET code that runs in a separate DLL. The DLL is compiled as a COM Server because, well, Excel-callable .NET UDFs have to be. So far, so good: Excel cells have "=foo(Range1, Range2, ...)", the VB.NET Com Server's UDF is called, and the cell obtains a value that

How to pass a variant object type 16396 in a COM method that requires an input value of a VT_VARIANT [12]

这一生的挚爱 提交于 2019-12-13 12:23:11
问题 I have in my PHP code, a COM object '$com_myObject' with a method 'myObjectMethod' which after I run com_print_type info($com_myObject); on it, it shows that it has the method 'myObjectMethod' declared as shown below myObjectMethod(/* VT_VARIANT [12] [in] */ $RawData) { /* Processes entered object data */ } In my code I am having another function return a variant object '$myInputObject' of type value 16396. I plan to use '$myInputObject' as the input value for 'myObjectMethod' method. print

Where can I find the list of interfaces supported by the WPF WebBrowser.Document from C#?

前提是你 提交于 2019-12-13 11:23:47
问题 Where can I find the list of interfaces supported by the WPF WebBrowser.Document (namespace system.windows.controls) from C#? Moreover, where can I find the official documentation from Microsoft web site? The document from MS http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.document%28v=vs.110%29.aspx only state this: Remarks The Document object needs to be cast to the COM interface you are expecting. But I cannot find the list of interfaces that I can expect from

Delphi XE - EOleSysError, but only when running in IDE/debugger

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 11:02:35
问题 I have seen other questions with this same problem on XE Forums, but still no answer. I run my application from with the XE IDE and I get an EOleSysError - 'The system cannot find the path specified'. But, I can go out to explorer to the same directory and run that same app outside the IDE and it runs fine. No errors. All of my assemblies are located in the build directory of the application, so I'm not relying on GAC or anything, just directory the executable is in. Is this a known bug with

How do I test performance impact of [STAThread] in WinForms?

廉价感情. 提交于 2019-12-13 09:12:35
问题 I managed to write a relatively large WinForms application in C# that functions correctly without the [STAThread] attribute on the Main() method. To accomplish this I had to override a lot of WinForms functionality (such as using a custom BeginInvoke and Invoke functions), use a custom message loop instead of Application.Run , use a custom file dialog instead of OpenFileDialog and SaveFileDialog , and use WM_DROPFILES for drag-and-drop instead of the WinForms out-of-the-box OLE approach. This

ActiveX component can't create object when using .net class in vba

余生长醉 提交于 2019-12-13 09:07:00
问题 I am trying to use a custom class exported as a .tlb in vba. I have done the regasm stuff but I keep getting this error when I try to call a subroutine within the class: Run-time error '429': ActiveX component can't create object I've referenced the class in vba, I've built the class for 32bit and 64bit CPUs and nothing worked. Anyways, vba code: Sub test() Dim test As New Mail.Class1 test.test End Sub And the vb.net code: Imports System.Runtime.InteropServices Public Class Class1 Public Sub