com

do clients running .net applications that reference the excel API need to have excel installed?

故事扮演 提交于 2020-01-16 19:00:07
问题 To be more specific, I'm referring to the COM component Microsoft.Office.Interop.Excel.dll. If clients don't have excel installed on their computer, would the .net application even run or just crash the moment there is an attempt to access the dll? Also, is it possible to work around any possible limitations by deploying a copy of this dll along with the .net application? (Assuming that it's legal to do so.) 回答1: If you're usig Excel COM Wrappers and you call any of the functions therein, you

CComModule::Unlock();

吃可爱长大的小学妹 提交于 2020-01-16 18:19:20
问题 I've been trying to determine what this function does, however I cannot seem to find it anywhere under the MSDN documentation of the CComModule class. Could anyone tell me what it is used for? 回答1: This function is for DllCanUnloadNow() to work properly. You know that when you call CoCreateInstance() for an in-proc server COM automagically calls LoadLibraryEx() to load the COM server DLL if necessary. But how long is the DLL kept loaded? In fact COM calls DllCanUnloadNow() for every loaded

Questions about COM/ActiveX objects

社会主义新天地 提交于 2020-01-16 18:14:14
问题 I have good knowledge on the working of a "traditional" .dll . Also the differences between dynamic loading and static loading , etc. But I have the following doubts about the working of COM objects, Is it mandatory to register COM objects with regsvr32 ? can I have two versions of a registered COM object lying in the same/different directory? besides being packaged inside a .dll file is there anything in common between a "traditional" .dll and a COM object ? 回答1: 1) No - it is NOT necessary

How to add unmanaged dll to show up in Add Reference's COM tab

落花浮王杯 提交于 2020-01-16 14:47:22
问题 I am currently trying to use pHash.dll on http://phash.org Unfortunately it was written in C++, I'd have to use DLLImport But the problem I am having is how to register pHash.dll (compiled thru VS2010/C++) I've tried to register using regsrv32 and have been fruitless giving an error message. Now, How can i register pHash to show up in COM tab? 回答1: The DLL in question exports flat APIs. The Add COM References Tab is for DLLs that expose COM objects. Instead of using Add Reference to refer to

Can't access Range method of Range object; COM limitations?

非 Y 不嫁゛ 提交于 2020-01-16 09:34:32
问题 In the Excel VBA Editor's Immediate Window, I can do the following: ?ActiveSheet.Range("C3:D4").Range("C3:D4").Address $E$5:$F$6 According to some simple tests, this doesn't seem to respond the same in Matlab. Here is the code to set up the COM interface for the tests: excel = actxserver('Excel.Application'); excel.Visible=1; wbks = excel.Workbooks; wbks.Add sht = wbks.Item(1).Sheets.Item(1) % % Run some range tests % try excel.DisplayAlerts = 0; % Forgo save prompt on Close end; try wbk

Error: Retriving the COM class factory for component with CLSID failed due to following error : 80040154

佐手、 提交于 2020-01-16 09:34:31
问题 I have a c# winforms application which i use to send audio out form a camera, which uses third party dll for connecting to device and sending audio out to device. when i run my application on my local machine then everything runs fine without any problem. Problem: But when i copy my application onto another machine and run it i getting this error Unable to send audio to this device. Error: Retriving the COM class factory for component with CLSID failed due to following error : 80040154

Calling C# From Unmanaged C++ Passing Or Returning “Complex” Types

做~自己de王妃 提交于 2020-01-16 05:02:59
问题 I'm after help on how to use complex objects either as return values or passed as parameters to C# class methods exposed to unmanaged C++ as COM components Here's why: I'm working on a project where we have half a dozen unmanaged C++ applications that each directly access the same Microsoft SQL Server database. We want to be able to use MS-Sql/Oracle/MySql with minimum changes and we've decided to implement a business logic plus data layer exposed via WCF services to get the required

Accessing COM Interface from C++ COM Server that doesn't register via C#

北战南征 提交于 2020-01-16 01:10:37
问题 I've been asked to integrate with an already-shipped product that is a COM server. Along with this product was provided a .tlb file. I've used tlbimp to export the tlb to primary assembly and I've included that in my C# project. When I attempt to execute my COM client I receive "No interface found" errors, because the application never registered its typelib in the registry. I've attempted to run "server.exe /RegServer" per the MSDN docs. It executes but doesn't seem to update or add anything

COM Interop with IPC in C#

你离开我真会死。 提交于 2020-01-16 00:26:40
问题 I have a question about IPC with COM Interop objects. I want to create and fill with data COM Interop object in one process (for example Windows Service written in C#). Then I want to get it in another process (console application in C#). I know that COM objects don't serialize and they are unmanaged code. I tried realize solution by .Net Remoting (Windows Service is server, console application is client), but I couldn't get COM Interop object in client (I made .net class inherited from

Set location of app.config file for interop com object

爱⌒轻易说出口 提交于 2020-01-15 15:57:49
问题 I am creating a windows com object in VS2010 and VB.net (interop) This com object should be able to work with any NON managed code application such as word, Excel or in this case Access. The creating of the com object and using regasm etc. works fine. No problem. However the INSTANT I create a com object that requires connection strings or anything else from the app.config file then it fails. In this case it happens to be a web service and the common "endpoint" or app.config file could not be