com

ATL COM events for javascript

安稳与你 提交于 2019-12-08 10:54:33
问题 I created an ATL COM server component (exe) some time ago. It exposed a few normal COM APIs (derived from IDispatch) and also fired a few COM events. The event mechanism was implemented using ATL IConnectionPointContainer. This COM server was initially used by a simple C# application, which directly added a reference to the COM server. Everything, the APIs and events, works fine in C# app. Then came the requirement for the COM server to able to used with javascript in a webpage (IE). I

How to get an enumeration value when using IMetadataImport

让人想犯罪 __ 提交于 2019-12-08 10:49:11
问题 Short version How to you get the numeric value associated with an enum from a *.winmd file when using IMetadataImport ? A good example is ApplicationHighContrastAdjustment enumeration: //Windows.UI.Xaml.ApplicationContrastMode (@020000006) public enum ApplicationHighContrastAdjustment : uint { None = 0u, Auto = 4294967295u } Most enumerations are 0, 1, 2, ... . But this one has other values specified on the enum members: 0 4294967295 How do i read get those UInt32 values Note : The question

Need help to understand why COM is missing in “Reference Manager”

拈花ヽ惹草 提交于 2019-12-08 09:37:54
问题 I don't have much experience with COMs. I have a project that references 2 COMs AxAXISMEDIACONTROLLib and AXISMEDIACONTROLLib When I manually delete AxAXISMEDIACONTROLLib I cannot add it back from "Reference Manager" since it's not shown there. The only COM that's there is AXISMEDIACONTROLLib . Can someone help to understand or give a direction to how AxAXISMEDIACONTROLLib was added at first place if it's not shown in "Reference Manager"? 回答1: When you add a COM reference, .NET will create an

Display file properties dialog for files in different directories

风流意气都作罢 提交于 2019-12-08 09:19:37
问题 I'm trying to open the default file properties dialog but unable to get it working property for files in different directories. I need to obtain IContextMenu* interface pointer for files in different directories (or even drives). I expect to see "Various folders" in the properties dialog. This is my naive approach: int main() { CoInitialize(NULL); LPOLESTR pszFile = OLESTR("c:\\Windows\\notepad.exe"); LPOLESTR pszFile2 = OLESTR("c:\\Windows\\System32\\notepad.exe"); LPITEMIDLIST pidl;

How to use COM to pass a string from c# to c++?

混江龙づ霸主 提交于 2019-12-08 09:12:07
问题 when i try to call c# code from c++, i followed instructions from this article http://support.microsoft.com/kb/828736 part of my c# is : [Guid("6A2E9B00-C435-48f8-AEF1-747E9F39E77A")] public interface IGameHelper { void getInfo(out string result); } public class GameHelper : IGameHelper { void getInfo(out string result) { result = new StringBuilder().Append("Hello").ToString(); } } part of my c++ code: #import "../lst/bin/Release/LST.tlb" named_guids raw_interfaces_only using namespace LST;

How to use embedded registration-free manifest for ActiveX component from managed code like C#?

﹥>﹥吖頭↗ 提交于 2019-12-08 09:07:02
问题 I would like to use a specific version of ActiveX component that is not registered system- or user-wide. Everything works as expected if I use manifest files. However embedded manifest works only for C++ client code only. Here is dependency declaration <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="MapWinGIS.ocx" version="4.9.1.0" /> </dependentAssembly> </dependency> If I use SxStrace, I see the following INFO: Parsing Manifest File C:\OSGeo4W\bin\TestApplication.exe.

Run a ATL COM DLL from a Browser (call a method)

不问归期 提交于 2019-12-08 08:37:05
问题 I have a COM Object created using ATL (without MFC Support) The Object has 1 method that opens a Dialog (that does all the rest) Currently I call it from another EXE: hr = CoCreateInstance( CLSID_MyControl, NULL, CLSCTX_INPROC_SERVER, IID_IMyControl, (void**) &pMyControl ); and then: hr = pMyControl->MyMethod (ATL::CComBSTR(InputString1), ATL::CComBSTR(InputString2), &IntReturned, &IntReturned); Is it possible to call it as is from a browser ? How can I Instantiate the object and invoke my

How to get properties from COM Object using the dynamic keyword

时光总嘲笑我的痴心妄想 提交于 2019-12-08 08:35:23
问题 I have a COM object returned from a 3rd party API. This COM object has a property on it that has a bunch of system information regarding that object... the property returned is of type "System.Object". When debugging this COM object, I see the property I'm interested in, and the Visual Studio debugger (2012) attaches a dynamic view to that object, allowing me to see that it's an array of some object like a dictionary... I'm able to hard code some dynamic keyword usage to extract the value out

Windows Application Automation with python/COM

怎甘沉沦 提交于 2019-12-08 08:21:37
问题 I'm trying to automate ChemDraw for a user in the background, preferably avoiding using SendKeys() as I believe that requires a ChemDraw instance to be visible for that to work. What I need to do is somehow click Edit -> Copy As -> InChI programmatically, then retrieve the result from the Windows clipboard. We're currently using Python and COM scripting to attempt this. Here's our current code: # Opens ChemDraw and loads the file, while keeping the window hidden. ChemDraw = w32.DispatchEx(

How to use VARIANT* with dynamicCall?

允我心安 提交于 2019-12-08 08:12:19
问题 I'm trying to use a COM object and i'm having problem with the parameter type VARIANT*. I can use the functions of the COM object just fine, except when they have a parameter of this type. The doc generated by generateDocumentation is : QVariantList params = ... object->dynamicCall("GetRanges(int,int,int&, QVariant&)", params); According to the doc provided with the COM object, the parameters should be of type LONG, LONG, LONG* and VARIANT*, and it is precised that the VARIANT* is a pointer