interop

possible to get/set console font size in c# .net?

白昼怎懂夜的黑 提交于 2019-11-28 00:49:12
I have seen posts on changing console true type font, console colors (rgb) but nothing on setting or getting the console font size. edit: reason = grid is output to console, grid has many columns, fits better in smaller font, wondering if possible to change at runtime rather than allowing default or configured fonts to take priority / override inheritance. james_bond Maybe this article can help you ConsoleHelper.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Drawing; namespace ConsoleExtender {

Stepping through VB6 COM object wrapped by .NET Class

隐身守侯 提交于 2019-11-28 00:23:22
I have a VB6 object that is wrapped by a .NET class. As far as I recall it is possible to step through a VB6 object by simply running the VB6 library and inserting a breakpoint at the desired location. However this does not appear to be working in my case. I have attempted to recompile the VB6 object and re-reference it in my .NET project but this doesn't appear to have helped. Where do I go from here? Is there a way to insert Debugger.Launch() equivalent into a VB6 project? Any help would be appreciated!! Jay Riggs Lifted from robgruen's blog : If you are using interop to call into a VB6

Microsoft.Office.Interop.Excel doesn't work on 64 bit

╄→尐↘猪︶ㄣ 提交于 2019-11-28 00:20:09
问题 I've encountered a problem when developing on MS Visual Web Developer 2008 Express Ed. Developing ASP.NET C# on Windows7 64 bit OS. I'm trying to open an Excel document, but it gives me Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) I did configured the build to all processors (Any CPU, x64, x86) but it doesn't work. I searched the answer on the internet but couldn't find out how to handle it. The weird thing is the same code worked on the same

Calling a Python module from Perl

人走茶凉 提交于 2019-11-28 00:14:49
问题 I created a module in Python which provides about a dozen functionalities. While it will be mostly used from within Python, there is a good fraction of legacy users which will be calling it from Perl. What is the best way to make a plug in to this module? My thoughts are: Provide the functionalities as command line utilities and make system calls Create some sort of server and handle RPC calls (say, via JSON RPC) Any advise? 回答1: One other choice is to inline Python directly in your Perl

Outlook 2007 from C# - COM exception, TYPE_E_LIBNOTREGISTERED

江枫思渺然 提交于 2019-11-28 00:03:02
I'm trying to make a program that would open new Outlook 2007 message. I've referenced from COM tab Microsoft Outlook 12.0 ObjectLibrary. These items showed up in references in VS: Microsoft.Office.Core Microsoft.Office.Inerop.Outlook Now I try to invoke following code: var _outlookInstance = new Microsoft.Office.Interop.Outlook.Application(); var _message = (OutlookApp.MailItem)_outlookInstance.CreateItem(OutlookApp.OlItemType.olMailItem); where OutlookApp==Microsoft.Office.Interop.Outlook namespace. While invoking second line of listing I keep getting this exception: (InvalidCastException)

C# and Excel interop

扶醉桌前 提交于 2019-11-27 23:48:08
One of my users is having an issue when trying to open an Excel file through my C# app. Everything works ok when I run it from my machine and it works for other users. I am no Excel interop expert so hopefully you guys can help me out. Here is how it is set up: I added a reference to my app to Microsoft.Office.Interop.Excel.dll, version 10.0.4504.0 (which I believe is Excel 2002). On my machine I have installed Excel 2007. In my code I try to open a worksheet like so: using Microsoft.Office.Interop ... Microsoft.Office.Interop.Excel.ApplicationClass _excelApp = new Microsoft.Office.Interop

What do I need to do to implement an “out of proc” COM server in C#?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 23:47:56
I am trying to implement an "out of proc" COM server written in C#. How do I do this? I need the C# code to be "out of proc" from my main C++ application, because I cannot load the .NET runtime into my main process space WHY?: My C++ code is in a DLL that is loaded into many different customer EXE's, some of which use different versions of the .NET runtime. Since there can only be one runtime loaded into a single process, my best bet seems to be to put my C# code into another process. You can create COM+ components using System.EnterpriseServices.ServicedComponent. Consequently, you'll be able

Java and MSMQ

随声附和 提交于 2019-11-27 23:34:07
I was curious if anyone had any suggestions on a Java library that provides access to MSMQ? I've downloaded the trial of the J-Integra Java-COM library and have built and run their MSMQ example app, but I was curious if there were any good (free :)) alternatives. I've run across a few JNI implementations like jMSMQ and a few others, but I'd rather avoid JNI if possible. We've also investigated some .NET<->JMS interop solutions like JNBridge (with ActiveMQ). I think our company has decided to centralize our queueing in MSMQ however, so that would be our ideal solution. We are hoping to use WCF

Convert Kotlin Array to Java varargs

谁说胖子不能爱 提交于 2019-11-27 23:24:26
How can I convert my Kotlin Array to a varargs Java String[] ? val angularRoutings = arrayOf<String>("/language", "/home") // this doesn't work web.ignoring().antMatchers(angularRoutings) How to pass an ArrayList to a varargs method parameter? You should use the " spread operator ", which looks like this: * The spread operator needs to be prefixed to the array argument: antMatchers(*angularRoutings) For further information, see the documentation : When we call a vararg -function, we can pass arguments one-by-one, e.g. asList(1, 2, 3) , or, if we already have an array and want to pass its

How to load an Excel Addin using Interop

帅比萌擦擦* 提交于 2019-11-27 22:35:45
问题 I have an AddIn which I want to invoke through Excel interop from a C# winforms application. I can't get the addin etc. to load unless I uninstall and resinstall it each time (this is apparantly something to do with Excel not loading addins when you use interop - btw, can't get their example to work in C#). Unfortunately this is slow and annoying to the user so I need to streamline it. I want to have one instance of Excel but load an already installed addin without forcing this install