com

Get WebBrowserControl's AxIWebBrowser2 Handle for use in InternetSetOption, COM issues with System.__ComObject

不问归期 提交于 2019-12-23 02:54:11
问题 I'm trying to set a proxy for only the current instance of a WebBrowserControl. The documentation is terrible but I believe that if I call wininet.dll 's InternetSetOption passing the IntPtr handle to the internal browser used by the WebBrowserControl as the first parameter then the method will only affect the current instance (and I can set a proxy using this method http://msdn.microsoft.com/en-us/library/aa385114(v=VS.85).aspx). However, the WebBrowserControl does not provide any means to

How to deploy a COM

核能气质少年 提交于 2019-12-23 02:52:27
问题 I just finished building my new COM project (C#, .NET 3.5). This project will be called by a VFP application. It's working great on my development machine, but now I need to know how to deploy it on the user's machine. Click Once isn't available for this kind of project, so I guess I'm stuck with manually distributing the DLL. So, where should I put the DLL and how do I register it? BTW, the 3.5 framework is already installed on the user's machine. TIA 回答1: I've really never used RegSvr32

.NET COM assembly interacting with Excel via BackgroundWorker

折月煮酒 提交于 2019-12-23 02:46:06
问题 I am writing (and teaching myself how to write) an experimental assembly in VB.NET 3.5 that is exposed via COM and then called from some Excel VBA code to initiate an instance of a class that traps some Excel events and then perform some functions on the active workbook in Excel. To initiate the class, a reference to the Excel Application is passed from the VBA (I am using a PIA for Excel in the assembly). I needed to perform a time-consuming operation on the active workbook from my assembly

COM Interop with VB6 and C#

寵の児 提交于 2019-12-23 02:43:31
问题 I'm writing a C# COM object that will be used by a VB 6 program. That shouldn't be much of a problem, however, the VB6 call to the COM object passes in a VB Control (in this case a TextBox). The program expects the COM object to alter the Text property of the control. Unfortunately, I have to stick to this interface as I'm dealing with someone elses legacy code. How can I set the property for the passed in TextBox? Do I simply create an interface with a Text property and cast input to that

Is possible having two COM STA instances of the same component?

有些话、适合烂在心里 提交于 2019-12-23 02:40:51
问题 I had a problem discovered on another thread here, I need to access a COM component that is STA. I'll run it on a dual-core computer, a process using this component only reaches 50% of CPU. Unfortunately, the owners said they can't change the component to MTA, because the component is a hybrid system compiled at Matlab, which core is C. So I tried to load two instances of the COM class on the same process, different threads accessing it, but I couldn't, only the last COM instance becomes

C# not connecting to R using RDotNet

廉价感情. 提交于 2019-12-23 02:34:08
问题 I am trying to interface C# to R using RDotNet . The following code is wants R to calculate the sum of two numbers and C# to get the result back and display it in the command window. using System; using RDotNet; namespace rcon { class Program { static void Main(string[] args) { string dllPath = @"C:\Program Files\R\R-3.1.0\bin\i386"; REngine.SetDllDirectory(dllPath); REngine.CreateInstance("RDotNet"); //REngine engine = REngine.GetInstanceFromID("RDotNet"); using (REngine engine = REngine

.NET RTD/COM Excel Interop errors on one user's machine?

懵懂的女人 提交于 2019-12-23 02:19:38
问题 We built a .NET COM/Excel RTD Server (.NET Assembly) which has been in use for many years, on a variety of machines (i.e. we know it works, and our standard method for installing it works). We have a user who installed this RTD component on a different machine, and is having problems getting it to function smoothly. I believe the problem relates to the Interop.Microsoft.Office.Interop.Excel.dll somehow being either incompatible with this machine, or else improperly registered. Here are

TWebBrowser modal print dialog?

自古美人都是妖i 提交于 2019-12-23 02:17:08
问题 I've found many ways to make the TWebBrowser show a modeless print dialog box, but how do I make it show a modal one? I would like to print an html page, that's why I need the modal dialog. I'd really appreciate your ideas on this one. Thanks! 回答1: I cannot think of a reason why there would be lots of ways to show a modeless dialog. Why would you want to continue interacting with the web browser while a modeless print dialog is displayed? If you want to initiate the print by program, but need

TWebBrowser modal print dialog?

人走茶凉 提交于 2019-12-23 02:17:03
问题 I've found many ways to make the TWebBrowser show a modeless print dialog box, but how do I make it show a modal one? I would like to print an html page, that's why I need the modal dialog. I'd really appreciate your ideas on this one. Thanks! 回答1: I cannot think of a reason why there would be lots of ways to show a modeless dialog. Why would you want to continue interacting with the web browser while a modeless print dialog is displayed? If you want to initiate the print by program, but need

Get running instances of Excel with VB.NET

戏子无情 提交于 2019-12-23 02:07:22
问题 I have the following working code taken from this answer: Option Compare Binary Option Explicit On Option Infer On Option Strict Off Imports Microsoft.Office.Interop Imports System.Collections.Generic Imports System.Runtime.InteropServices Friend Module Module1 Private Declare Function GetDesktopWindow Lib "user32" () As IntPtr Private Declare Function EnumChildWindows Lib "user32.dll" (ByVal WindowHandle As IntPtr, ByVal Callback As EnumWindowsProc, ByVal lParam As IntPtr) As Boolean Private