com

DEBUG ERROR : Runtime needed for <name.exe> occurs while cusing COM in vc++ project?

不打扰是莪最后的温柔 提交于 2019-12-31 07:12:12
问题 I have created a COM component for my work. I have registered the component also. On my system I have two VM workstations. In my first workstation it works fine. In my second workstation it displays an error box containing the message this program needs a rumtime and closes an unusual way please contact applications administrator . I thought that this was because of not registering the dll in the second worksation then I registered and it works fine. When i tried to test the same in win2k8

Register C# COM Object without having a real file for RegAsm

跟風遠走 提交于 2019-12-31 07:05:11
问题 I have a wierd application loading mechanism. I have a boostrapping exe file with all the other DLLs and the application itself inside it's resources. These files (assemblies) are extracted from resources and loaded ond emand because i'm attaching to the Assemblyresolve event of the current AppDomain. [STAThread] static void Main() { // if the command line contains extract then extract the dlls, next run will resolve assemblies from disk bool saveDllsToDisk = new List<string>(Environment

Retrieving dll version info via Win32 - VerQueryValue(…) crashes under Win7 x64

你。 提交于 2019-12-31 06:54:48
问题 The respected open source .NET wrapper implementation (SharpBITS) of Windows BITS services fails identifying the underlying BITS version under Win7 x64. Here is the source code that fails. NativeMethods are native Win32 calls wrapped by .NET methods and decorated via DllImport attribute. private static BitsVersion GetBitsVersion() { try { string fileName = Path.Combine( System.Environment.SystemDirectory, "qmgr.dll"); int handle = 0; int size = NativeMethods.GetFileVersionInfoSize(fileName,

How to return List from c# and use it in vc++ through com

Deadly 提交于 2019-12-31 05:20:10
问题 How to return List from c# method and Use the List return values in c++ can u give guidance how to do it?? I going like following way my complete scenario: in c# DemoLib.cs usng System;using System.Collections.Generic; public interface IDiscover { void GetList1(); String GetList2(); List<string> GetList3(); }; namespace DemoLibrary { class DemoLib { public void GetList1() { Console.WriteLine(" I am from Void GetList()"); } public string GetList2() { Console.WriteLine(" I am from string

ADO Recordset->EndOfFile giving me _com_error when Empty Recordset

三世轮回 提交于 2019-12-31 04:47:21
问题 I'm using ADO, and getting a very weird com error. So I'm simply running a stored proc using ADO CommandPtr, and storing it in a Recordset. Here is what I'm doing: _ConnectionPtr Connptr; //Instantiate ConnectionPtr... _CommapndPtr CommPtr; CommPtr.CreateInstance(__uuidof(Command)); CommPtr->CommandType = adCmdText; CommPtr->ActiveConnection = ConnPtr; CommPtr->CommandText = "Execute MyDb..MyStoredProc"; _RecordsetPtr RecPtr; RecPtr.CreateInstance(__uuidof(Recordset)); RecPtr->CursorLocation

Does .NET define common HRESULT values? [duplicate]

落花浮王杯 提交于 2019-12-31 04:22:34
问题 This question already has answers here : HRESULT Enumeration C# (4 answers) Closed 4 years ago . I'm creating a COM class in C#, which will be called from unmanaged C++. I want to use ThrowExceptionForHR but I'd rather not have to hard-code HRESULT numeric values. I was expecting there would be some enum of common HRESULT values in .Net somewhere? Put another way, where can I find named symbols which map to HRESULT values to pass into ThrowExceptionForHR ? Update: MS talk about it in this

win32com.client.Dispatch Class Label

雨燕双飞 提交于 2019-12-31 03:49:45
问题 I am trying to connect to a COM object using python. More specifically, I am using ASCOM standard drivers to connect to a MaxDome II, and do not know how to reference this driver. In this link the author uses "Celestron.Telescope" as their parameter for the win32com.client.Dispatch instantiation. My question is how to find this string. I understand that it is related to the installed drivers, which are installed on the computer, but I don't how to locate the specific string. Is there a way to

Getting the GUID of an installed COM object

风格不统一 提交于 2019-12-31 03:15:11
问题 I have a 32bit COM object that I want to use with 64bit PHP. I am trying to follow the tutorial here: http://www.gfi.com/blog/32bit-object-64bit-environment/ But I am stuck on "Locate your COM object GUID", as I have no idea where I can find out this information. Does anyone know how I can find the GUID of the COM object? 回答1: You will at least have to know the ProgID of the COM component. Something similar to "Word.Application", the string you pass to the COM() constructor. Run Regedit.exe

Excel interop COM doesn't close

主宰稳场 提交于 2019-12-31 02:55:12
问题 I have some code that opens a spreadsheet, reads some values, and then closes the sheet. I need to do this for multiple files. The problem I'm having is that the Excel application instance is not exiting, therefore when I run my process for several files, I end up with several excel.exe processes running. Any ideas how I get Excel to close? static void ParseFile(string file) { try { System.Console.WriteLine("parsing:" + file); Excel.Application excel = new Excel.Application(); Excel.Workbook

Determine the Process ID of the Client Process communicating with a COM RPC Server

落花浮王杯 提交于 2019-12-31 02:08:48
问题 In a COM RPC Model, if the Server is running on a separate process, is it possible to know, the Process ID of the client Process communicating with the Server? Use Case I have an Out Process RPC Server which can receive request from one or more client process. Occasionally, the server needs to know the Client Process to write data back to the client address space using Write Process Memory. Also Note, the API Signatures, the way the buffer is getting allocated and the APIs are getting called