com

don't know how to use IShellWindows::Item correctly

点点圈 提交于 2019-12-13 07:00:47
问题 I'm using VC6 on XP system. The following is my code. It runs perfectly on my computer, but on other computers it seems that pisw->Item(v, &pidisp) doesn't equals to S_OK. Now I'm trying to figure out what's wrong here IShellWindows *pisw; if (SUCCEEDED(CoCreateInstance(CLSID_ShellWindows, NULL, CLSCTX_ALL, IID_IShellWindows, (void**)&pisw))) { VARIANT v; V_VT(&v) = VT_I4; IDispatch *pidisp; found = FALSE; for (V_I4(&v) = 0; !found && pisw->Item(v, &pidisp) == S_OK; V_I4(&v)++) {

Use .NET dll as COM

和自甴很熟 提交于 2019-12-13 06:59:11
问题 I have a somewhat convoluted issue where I need to call a WCF web service from a SQL Server 2005 stored procedure. While researching I discovered that the only version of .NET SQL Server 2005 will natively support it 2.0 - yet I needed to use a client to consume the web service written for .NET 4. After playing around with some workaround to try to get SQL Server to recognize a .NET 4 DLL I decided to simply create a .NET 2 CLR stored procedure and use a wrapper class written in .NET 4

Windows Scripting can't find reference

ε祈祈猫儿з 提交于 2019-12-13 06:59:04
问题 I have a windows script file that doesn't work anymore. The script look like this <job> <reference object="Some.Component.1" /> <script language="VBScript"> x = CreateObject("Some.Component.1") MsgBox TypeName(x) </script> </job> When I run the script with cscript or wscript I get the error Windows Script Host: Cannot find the type library for this reference : Some.Component.1 The error code is 0x80040068 which means "Invalid index". (I tried to removed the .1 index but it didn't work) The

PHP - COM does not work in IIS

旧街凉风 提交于 2019-12-13 05:53:15
问题 I'm having an issue trying to get COM to work on my local iis server running php. This is related to an earlier post but now i am finding COM just simply does not load anything. I've tried this... new COM( 'ADODB.Connection' ) I've also tried this... new COM("WScript.Shell") both of these lines of code will not work. They do not throw errors, just simply die and do not execute any further in the code. I've tried catching an exception in a try-Catch but nothing gets returned. I'm guessing that

C# and COM, IFontDisp getting converted to StdFont

我怕爱的太早我们不能终老 提交于 2019-12-13 05:53:00
问题 I am creating a COM (User Control) in C# to be used in Excel-VBA. It compiles without error and I can register it on my machine. In this COM I have the property declared like this stdole.IFontDisp Font_Test { get; set; } But in the VBA, the return type automatically gets changed to stdole.StdFont So in VBA it becomes stdole.StdFont Font_Test Why is this automatic type conversion is happening and how can I fix this? Thanks! Edit: As per Hans's answer I checked the type library and yes it gets

How to register a .NET assembly in place of an existing COM server?

左心房为你撑大大i 提交于 2019-12-13 05:27:28
问题 I have to deal with a COM class which is more or less a black-box component of a bigger system. This class comes from a COM EXE and is registered in the system with a known AppID and Typelib ID. For debugging and logging purposes, I created a mock class which implements this same interface in C#. The question is: how can I register my assembly so that when the calling application tries to instantiate the interface it will instantiate my class instead? Edit with more information: I have the

Passing a reference to a COM object accross processes via IPC?

喜欢而已 提交于 2019-12-13 05:23:57
问题 I have a reference to a COM object, and would like to pass that reference on to another process. So, I'd need some way to serialize information about this reference that would allow me to restore it again in the other process. Is there any way to do this for COM objects of any arbitrary type? I'm don't know too much about COM; from what I understand, there may be Monikers for some types of objects (for example, COM references such as Excel.Workbook might be restored via their .FullName

Register 32-bit COM server (and generate TLB) for use with 32-bit and 64-bit clients

懵懂的女人 提交于 2019-12-13 05:18:25
问题 Method 1: x86 target platform I have a .NET class library that is intended for use with both 32-bit and 64-bit clients, some of which are .NET projects and some of which are C++ MFC projects. I can get the library to work with the 32-bit clients, but the 64-bit clients get a "Class not registered" exception. Poking around the registry, it looks like only the win32 key is being set (HKEY_CLASSES_ROOT\Wow6432Node\TypeLib{GUID}\1.0\0\win32). Some notes on a few of my settings: "Register for COM

how to reference a com exe from unmanaged c++?

自作多情 提交于 2019-12-13 05:03:37
问题 I am not very familiar with unmanaged c++, as I've only worked with MFC and Dot Net. I have an unmanaged dll that I would like to reference an out of process server. I've tried the following: #import "C:\Program Files (x86)\statconn\DCOM\bin\StatConnectorSrv.exe" using namespace STATCONNECTORSRVLib; and #import "C:\Program Files (x86)\statconn\DCOM\bin\StatConnectorSrv.tlb" using namespace STATCONNECTORSRVLib; STATCONNECTORSRVLib contains the object StatConnector. However when I try to

Excel 2007 Zombie Process not COM automation but w/ references to 3rd party com objects

风流意气都作罢 提交于 2019-12-13 04:34:29
问题 I'm developing an app that uses Excel on the front end and accesses remote data through a 3rd party API over COM. The app is directly coded in Excel VBA (i.e. no COM automation of Excel.) Sometimes Excel doesn't exit when the user quits, after running my app, thereby creating a zombie Excel that consumes ~50% of CPU. I've read the existing 'Excel won't exit' answers here on SO - they all seem to be related to Interop / COM automation of Excel. Any suggestions on how to ensure Excel exits in