com

Class not registered error from PHP

匆匆过客 提交于 2019-12-10 17:17:49
问题 We've created a C# class library assembly and made it COM visible to be able to call its methods from PHP. This used to work fine, but now we wanted to install it on a Windows Server 2008 server and we keep walking into the error "Class not registered". To rule out any dependency problems I made a tiny little test class library in C#. The class library is built for Any CPU and it is COM visible (also set COMVisible to true in AssemblyInfo.cs). The test class library only contains one class

UI thread is blocking a background thread calling a COM object

匆匆过客 提交于 2019-12-10 17:04:57
问题 I am working on an application that communicates with an external device via a third-party COM library. I'm attempting to have all communication to the device go through a background thread both to prevent problems with communication from screwing up my app and to get rid of some other complexities introduced by having communication in the UI thread. The problem is that whenever something happens that causes the main UI thread to block (i.e. MessageBox.Show being called or even just moving

Accessing COM Object From Thread Other Than Main Thread Slow In C#

时光毁灭记忆、已成空白 提交于 2019-12-10 16:45:19
问题 I have a proprietary COM library that returns an array of integers (in their own proprietary format of course). When I access this array from the main UI thread, all is well and runs quickly. When I access it from another thread, the access is very slow. There's some sample code below. private void test() { ProprietaryLib.Integers ints = ProprietaryLib.GetInts(); int x; for(int i = 0; i < 500; i++) for(int j = 0; j < ints.Count; j++) x = ints[j]; } private void button1_Click(object sender,

Is the exception message raised by a C# COMponent passed through interop to C++?

谁说胖子不能爱 提交于 2019-12-10 15:57:17
问题 If I implement a COM interface in a C# class, which will be called from a C++ module, then in case of a failure the C# code should throw an exception; this will be marshalled to a HRESULT failure code by the interop layer. But will any message text (or other information) passed to the Exception constructor also be available to the calling C++ code? If so, how can it be obtained i.e. which API methods? e.g. if in my C# code I do throw new ArgumentException("The email address is invalid") I

Calling a Visual Basic DLL in C++, Part 2

冷暖自知 提交于 2019-12-10 15:32:18
问题 This question is a follow up to a previous question (here). I have acquired a DLL that was created in Visual Basic from a third party vendor( Sensor DLL.dll ). This DLL contains functions for talking to a sensor, and I need to call these functions from a Visual C++ program I am writing. The vendor will not provide a header file, and I do not know Visual Basic. I have a small amount of documentation on each function. For example, I am told one function ( Get_Data ) in the DLL is of the form:

Can't instantiate COM component in C# - error 80070002

自古美人都是妖i 提交于 2019-12-10 15:30:33
问题 I'm attempting to instantiate a Windows Media Player COM object on my machine: Guid mediaPlayerClassId = new Guid("47ac3c2f-7033-4d47-ae81-9c94e566c4cc"); Type mediaPlayerType = Type.GetTypeFromCLSID(mediaPlayerClassId); Activator.CreateInstance(mediaPlayerType); // <-- this line throws When executing that last line, I get the following error: System.IO.FileNotFoundException was caught Message="Retrieving the COM class factory for component with CLSID {47AC3C2F-7033-4D47-AE81-9C94E566C4CC}

Instantiating a COM Component fails with “Class not registered” when “Run As Administrator”

旧巷老猫 提交于 2019-12-10 15:24:37
问题 When instantiating a COM Interop object: var comObj = new ComComponentClass(); I get the COMException : Retrieving the COM class factory for component with CLSID {C343ED84-A129-11D3-B799-0060B0F159EF} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). I only get this error when I launch my application with Run as Administrator . When I run normally, the error does not occur. Notes: The application is 64-bit application.

COM “get property” with multiple arguments

你离开我真会死。 提交于 2019-12-10 15:12:39
问题 I'm trying to call WindowsInstaller.Installer.ProductsEx from python, and can't figure out how to make it work. Here's a vbscript version of what I want to call from python: dim msi, products set msi = CreateObject("WindowsInstaller.Installer") set products = msi.ProductsEx("", "s-1-1-0", 7) I think my issue is ProductsEx is a read-only get property that takes 3 arguments, and I don't know how to convince win32com or comtypes to call it that way. I tried: >>> import win32com.client >>> msi =

Memory consumption when using Delphi7 COM interfaces in a multithreaded way

℡╲_俬逩灬. 提交于 2019-12-10 14:46:05
问题 It seems that there is some memory problem in Delphi7 when accessing COM object interfaces such as IXMLDocument and IXMLNode - and so forth - in a multithreaded way. Other COM interfaces may share this problem, but my "research" isn't that deep cause I have to proceed my current project as well. Creating TXMLDocument and manipulating it via interfaces like IXMLDocument and IXMLNode on a single thread is ok, but in a multithreading approach, when one thread creates the TXMLDocument object and

Trouble with VB6 app, bringing a dialog to front and focus on Windows 7

╄→尐↘猪︶ㄣ 提交于 2019-12-10 14:28:11
问题 I have a small utility app written in Visual Basic 6 that has been happily running on XP clients for many years until recently a client who is using Windows 7 has notified and shown me that the behaviour is different. When my VB app displays the dialog, it remains hidden until the user clicks on it in the taskbar. I changed the code so rather than using a ".show vbModal" command, I changed to displaying the form with non-modally, and then added various API calls like BringWindowToFront and