interop

Outlook Interop c# sort items not working

↘锁芯ラ 提交于 2019-12-11 02:22:12
问题 I have stumbled upon a problem where the Outlook items table sort method does not give desired results - despite the ascending or descending the method GetLast() always returns the same email item. Code as follows: Application olApp = new Application(); NameSpace olNS = olApp.GetNamespace("MAPI"); MAPIFolder oFolder = olNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox); Explorer oExp = oFolder.GetExplorer(false); //olNS.Logon( false, true); result = new IOActionResult(null); oFolder.Items

Unmanaged code calling vb.net callback

℡╲_俬逩灬. 提交于 2019-12-11 02:17:07
问题 I am upgrading vb.net app that handles the events of a COM object (possibly written in VB6) from framework 1.1 to WPF 2.0/3.5 The code: (object names simplified for brevity) public class MyClass Private WithEvents serviceMonitor As COMOBJECT.ServiceMonitor Public Sub New() serviceMonitor = New COMOBJECT.ServiceMonitor() serviceMonitor.Connect([some ip address]) End Sub Private Sub ServiceMonitor_ServiceConnectionUp(ByVal MonitorId As Integer, ByVal UserArg As Integer) _ Handles serviceMonitor

How to Consume COM Server (ATL, DLL Surrogate) in .NET C# WinService?

岁酱吖の 提交于 2019-12-11 02:16:43
问题 I have a DLL Com Server, actually used only by one old Delphi exe-application. COM Server is written many years ago (not by me) in C++ ATL. It implements callbacks (event - is it the same?) - using outgoing interface IConnectionPointImpl . Class Factory is singleton (marked with DECLARE_CLASSFACTORY_SINGLETON ) Now it is required that this COM Server have to be shared between more than one clients: both Delphi and C# (.NET 2.0, VS2008). I put it as DllSurrogate and now I can use it from

Using a UWP C++ dll in Win32 C# WPF application

久未见 提交于 2019-12-11 02:07:09
问题 I'm attempting to use the SimpleCommunication C++ DLL that Microsoft in one of their UWP sample examples inside a Win32 C# WPF application. https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/SimpleCommunication/common/MediaExtensions/Microsoft.Samples.SimpleCommunication I've tried to add a reference to the both the .dll and .winmd files that are generated when building the SimpleCommunication .dll into my Win32 C# WPF application however whenever I attempt to call any

How can I pass a collection of objects from VB6 to .NET?

家住魔仙堡 提交于 2019-12-11 02:04:53
问题 I need to pass a collection of key/value pairs of strings from VB6 to .NET. In VB6 code they exist in a native collection. But I am not sure what I can reference in my .NET project to be able to accept a parameter of type Collection in one of my methods. I tried adding a reference to Visual Basic for Applications but got back "A reference to 'Visual Basic For Applications' could not be added." Am I going about it the wrong way? 回答1: You could use something like this in c#: [Guid("fb5e929a

Why people don't do WSDL-first?

淺唱寂寞╮ 提交于 2019-12-11 01:39:13
问题 I'm currently making a presentation that deals with web services. We created our service using WSDL+XSD-first approach, in which we first created (with the aid of tools) the XSD schema and WSDL and then compiled both to .NET and Java classes for interoperation. I want to justify why we used this approach. I mentioned that it's more OOP-compliant (first define interface, then implementation, not vice versa) and that you have more control over interoperability constraints. Also, you can define

Interprocess Communication in C++

和自甴很熟 提交于 2019-12-11 01:36:41
问题 I have a simple c++ application that generates reports on the back end of my web app (simple LAMP setup). The problem is the back end loads a data file that takes about 1.5GB in memory. This won't scale very well if multiple users are running it simultaneously, so my thought is to split into several programs : Program A is the main executable that is always running on the server, and always has the data loaded, and can actually run reports. Program B is spawned from php, and makes a simple

Call CLR code from JVM

梦想与她 提交于 2019-12-11 00:53:39
问题 Is it possible to call CLR methods from JVM? Any library that would host a .NET CLR instance inside JVM, and provide a simple mapping for Java? Are there any libraries that would do that? I'd like to write a plugin for existing Java application which already runs on JVM. I'd like to avoid having two binaries. I only want to call few methods in an existing .NET assembly (MSBuild-related Microsoft.Build.Framework.* stuff). 回答1: Natively no this is not possible. The Java and CLR virtual machines

wcf Interop: No timestamp is available in security header to do replay detection

妖精的绣舞 提交于 2019-12-11 00:10:03
问题 I am trying to call a Java service using WCF. The service sends a message back but it does not make back to my program. WCF generates: No Timestamp is available in security header to do replay detection. I captured the returned message in Fiddler and there is a Timestamp field in the body. <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:SOAP-ENV="http:/

How can I import an RSA private key into an RSACryptoServiceProvider?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 23:14:30
问题 I'm trying to import an RSA public/private key pair generated with the Win32 Crypto API into a .NET application. The code that creates and exports the key pair looks something like this: // Abbreviated for clarity. CryptAcquireContext(..., MS_ENHANCED_PROV, ...); // Generate public/private key pair CryptCreateHash(..., CALG_SHA1, ...); CryptHashData(hash, password, ...); CryptDeriveKey(..., CALG_3DES, hash, CRYPT_EXPORTABLE, ...); CyrptExportKey(..., derivedKey, PRIVATEKEYBLOB, ...);