com

Windows Limited User Installation

大城市里の小女人 提交于 2019-12-04 12:41:17
I have a Win32 application that includes an EXE, an ActiveX control (DLL) and a COM server (EXE) and I am using Inno Setup 5 to build my installer. Many of our customers use limited user accounts where the user has no admin rights and because the COM components require to be registered (which writes to HKEY_CLASSES_ROOT), my setup file must run with elevated (admin) privileges. I think this in unavoidable (sadly, I can't use registration-free COM because of the EXE COM server I have). However, I would like to create an update installer that can be ran as a limited user and am looking for some

Packaging IDispatch Invoke with Parameters in C# (with DISPPARAMS)

一笑奈何 提交于 2019-12-04 12:38:44
I'm using Invoke for late binding on a legacy COM objects that supports IDispatch. This seems necessary as .NET's Type.GetMethod Type.InvokeMember do not seem to work on these objects. The following code works fine for getting a property from an object, the caller passes in the property name as a string for getting the property value with late binding. The class takes an object in its constructor and sets up this.idisp (and this.lcid) as an interface pointer to the object (Critiques welcome!) public object InvokeGet(string propertyName) { int id = GetDispID(propertyName); IntPtr[] pArgErr =

Where do I need to switch the Activation Context?

无人久伴 提交于 2019-12-04 12:35:24
The problem I'm facing is essentially described here , that is: I have a DLL that is using a 3rd party in-process COM component dll. I want to use registration free COM with that in-process component. I want to embed and use a manfest into this DLL (not into the main EXE) so that I can use the 3rd party component in a reg free way. The Interface I use from the component is activated through a call to CoCreateInstance . The 3rd party COM component hasn't got any further (COM) dependencies and doesn't rely on or need isolation. I see that simply embedding a manifest into my DLL doesn't work, as

Get a screenshot from an ASP.Net page

跟風遠走 提交于 2019-12-04 12:26:22
问题 I have an ASP.Net page that has a button that when clicked I would like to take a screenshot of the user's PC and send it to a server. I'm ok with writing some sort of listener program to run on the server to accept requests to receive these images. Where I'm a bit hazy is the best way to get the user's PC to send the screenshot. Would this need to be done by writing some sort of Active X control for the ASP.Net page? It needs to be cross browser and operating system if possible. Just a point

Fatal error: Class 'COM' not found PHP. Win7 - Apache - PHP

血红的双手。 提交于 2019-12-04 12:22:36
问题 $myapp = new COM("word.application"); // returns a fatal error: "Class 'COM' not found in c:/www/comConnector.php" shell_exec("whoami"); //returns "NT authority/system" My system setup Win7 Pro Apache Server version: Apache/2.2.23 (Win32) PHP PHP 5.3.16 (cli) (built: Aug 15 2012 20:06:57) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies 回答1: Add COM support in php.ini: [COM_DOT_NET] extension=php_com_dotnet.dll 回答2: Since you are using PHP 5

C# COM Cross Thread

旧城冷巷雨未停 提交于 2019-12-04 12:21:04
we're developing a software to control a scientific measuring device. it provides a COM-Interface defines several functions to set measurement parameters and fires an event when it measured data. in order to test our software, I'm implementing a simulation of that device. the com-object runs a loop which periodically fires the event. another loop in the client app should now setup up the com-simulator using the given functions. I created a class for measuring parameters which will be instantiated when setting up a new measurement. // COM-Object public class MeasurementParams { public double

Why do COM libraries used from C# 4.0 require such heavy use of dynamic types?

强颜欢笑 提交于 2019-12-04 12:19:13
In the C# 4.0 demos, I'm seeing lots of code that uses the dynamic type. For example, the following code sets the value of an Excel cell: excel.Cells[1, 1].Value = ... However, you can also access the cell in an early bound manner with a cast: ((Range)excel.Cells[1, 1]).Value = ...; Why don't the Excel COM library just describe the Cell type as a Range type in the first place? Similarly, all the arguments to the following method are dynamic: excel.ActiveWorkbook.Charts.Add(...) Why couldn't the arguments have been static? Looking at the Excel object model, there are dynamic types everywhere.

How do I read the formatted textual representation of a cell in Excel

点点圈 提交于 2019-12-04 12:14:39
I'm using the COM interface to Excel and I would like to get hold of the formatted textual representation of a cell rather than the true underlying value. For example, suppose the cell contains the number 1.23456 and the user has specified the number format with 1 decimal place. Then I'd like to be able to read the string "1.2" . I know that I can use Range.Text but this fails in a couple of significant ways. Range.Text returns what the user sees in the view of the sheet and so if the cell is hidden then the empty string is returned. If the cell's width is low then a truncated string is

COM: Create a VT_ARRAY with VT_BSTR values

有些话、适合烂在心里 提交于 2019-12-04 12:14:11
I'm a COM newbie and I think what I have is correct, but the runtime doesn't like it. Any help is much appreciated. I need to invoke a COM function that takes in a single dimensional array of BSTRs. Specifically, the documentation says the parameter must be: Function: AddFiles ( [in] VARIANT * filePaths ) filePaths The single-dimensioned array of full paths to each file or folder. filePaths can be of type VT_ARRAY|VT_VARIANT , where each entry is a VT_BSTR , or VT_ARRAY|VT_BSTR . I have a vector<wstring> myPaths of paths which I want to pass into the function that takes the parameter above.

Does COM interop respect .NET AppDomain boundaries for assembly loading?

怎甘沉沦 提交于 2019-12-04 12:10:55
问题 Here's the core problem: I have a .NET application that is using COM interop in a separate AppDomain. The COM stuff seems to be loading assemblies back into the default domain, rather than the AppDomain from which the COM stuff is being called. What I want to know is: is this expected behaviour, or am I doing something wrong to cause these COM related assemblies to be loaded in the wrong AppDomain? Please see a more detailed description of the situation below... The application consists of 3