com

Windowless ActiveX controls are not supported windows 2008R2 - Works in Windows 7

牧云@^-^@ 提交于 2019-12-11 18:24:09
问题 I have a windows forms application that uses legacy vendor com objects. I've registered the ocx. The VS2010 project succeeds in referencing the axFOO dll. The code works in Visual studio running on Windows 7. The setup project installs correctly and if installed on my local PC (win7) it works. When I attempt to install on a windows 2008 VM, installation is successful, when the portion of the application that uses the object is executed it fails with this error: Unable to get the window handle

How can I instantiate a COM class interface generically

这一生的挚爱 提交于 2019-12-11 18:17:52
问题 I'm trying to refactor a piece of code and ran out of options I can think off. This is the original code I had: if (WebConfigSettings.ComPartition == null && HttpContext.Current != null) Nses = new NSession(); else Nses = (INSession)Marshal.BindToMoniker(string.Format("partition:{0}/new:NuntioServer.NSession", WebConfigSettings.ComPartition)); AND if (WebConfigSettings.ComPartition == null && HttpContext.Current != null) apses.Wses = new WSession(); else apses.Wses = (IWSession)Marshal

Struggling creating a COM object with Visual Studio 2010 which is visible from VBScript run from the command line

不问归期 提交于 2019-12-11 18:17:00
问题 I am struggling trying to build a COM object in Visual Studio (2010) in VB.NET which can be called from a VBScript program run from the command line. I want the script to be able to do something like ... Option Explicit Dim trips Dim results Set trips = CreateObject("Hartley.Trips") Set results = trips.selecttrips(57,now()) wscript.echo results.count However whatever I do, this script fails with: ActiveX component can't create object:'Hartley.Trips The core of the COM object definition is ...

Troubleshooting COM error “The parameter is incorrect”

牧云@^-^@ 提交于 2019-12-11 18:14:31
问题 Environment is Delphi XE2 Enterprise. Relates to use dispInterface in Delphi with no classid. Re-posting as a different question as I have moved well beyond the previous issues (thanks to @EricBrown) and now have a more specific problem. I've got a .NET dll with a COM interface that I've registered on the computer and have imported as a type library into Delphi. I'm using the tlb.pas file that Delphi created. Working with a couple of dispInterfaces that I've implemented in IDispatch

C++ Builder 2009 - How to Determine if Control's Window is Visible

我与影子孤独终老i 提交于 2019-12-11 18:05:38
问题 I have a TWinControl and am trying to determine if the parent window is visible. I see TWinControl has a property of ParentWindow . The return type of ParentWindow is void * . So I'm curious if I must cast to a particular type, which would then give me access to check if the window is visible or not. Does anyone know the type I need to cast to, or another way to accomplish this? Additional Troubleshooting Notes, Part 1: I tried to get the ParentWindows class by: String parentWindowClassName =

Passing an array of Structs to a COM Interface

有些话、适合烂在心里 提交于 2019-12-11 17:59:28
问题 I have a COM interface with an IDL file with the following declared: typedef [uuid(D7B6C495-FFF3-11E0-8A39-08002700D831)] struct PORT_CONFIG { unsigned char rack; unsigned short port; unsigned char offset; } PORT_CONFIG; [object, uuid(D7B6C492-FFF3-11E0-8A39-08002700D831), dual, nonextensible, pointer_default(unique)] interface IMED704 : IDispatch { [id(5), helpstring("method PortConfig")] HRESULT PortConfig([in] SAFEARRAY(PORT_CONFIG) portCfg, [in, defaultvalue(-1)] VARIANT_BOOL clearInputs)

DISPID_VALUE and varargs weird behaviour

三世轮回 提交于 2019-12-11 17:56:36
问题 I am getting really strange behaviour mixing DISPID_VALUE and varargs in IDL/C++/VBA. I have the following definitions in my IDL file [ uuid(78fc63e0-fdb5-11e1-a21f-0800200c9a66), dual ] interface IPyObj : IDispatch { // ... [propget, id(DISPID_VALUE)] HRESULT Item( [in] VARIANT* Key, [out, retval] VARIANT* Result ); // ... }; // ... [entry("PyTuple"), helpstring("Builds a Python tuple object"), vararg] HRESULT __stdcall PyTuple( [in] SAFEARRAY(VARIANT)* Elements, [out, retval] VARIANT*

How to retrieve object pointer from ATL collection of objects?

限于喜欢 提交于 2019-12-11 17:51:57
问题 I have a collection of objects that is defined as: typedef IField ItemInterface; typedef CComObject<CField>* ItemClassPtr; typedef CAdapt< CComPtr<ItemInterface> > ItemType; typedef std::vector< ItemType > ContainerType; and I have created several of the CField objects via a series of calls (ignoring hresult): IField* ppField = 0; hresult = CField::CreateInstance(&ppField); ItemType spField = ppField; m_coll.push_back(spField); ppField->Release(); and now I'm trying to retrieve a pointer to

IDispatch returns DISP_E_UNKNOWNNAME for CommandBarButton.Style

痞子三分冷 提交于 2019-12-11 17:27:16
问题 I have a Visual Studio add-in, which contains a scripting engine implemented in C++. The add-in can only communicate with Visual Studio using IDispatch interfaces. I am in the process of upgrading it from VS 2005 to VS 2010. The add-in makes a series of IDispatch::Invoke() calls equivalent to this Visual Basic: control = commandBar.Controls.Add(MsoControlType.msoControlButton) control.Caption = "My button" control.FaceId = 59 In VS 2005, this used to work. But in VS 2010 it doesn't.

Interop UserControl acts different in .NET and COM

怎甘沉沦 提交于 2019-12-11 17:26:35
问题 I've got an UserControl that works in a quite strange way. By calling a method, the control opens an application in background, take the handle of a form and adds the main control of that last to its own controls. This is the last piece of the code i used: Dim controlHandle As IntPtr = New IntPtr(WinHandle) Dim controlWin As Control = Control.FromHandle(controlHandle) Dim controlView As Control = controlWin.Controls("viewSitePanel") controlView.Dock = DockStyle.Fill Controls.Add(controlView)