interop

WCF Interop with Axis2 using WS-Trust

久未见 提交于 2020-01-01 03:10:14
问题 We are trying to get WCF and Java talking to each other using SAML tokens issued from an STS. Despite the fact that both sides are compliant with the standards, WS-Security, WS-Trust, WS-Policy, etc., they don't seem to talk to each other and one or the other will throw cryptic exceptions or ignore security headers. We are using .NET 3.5, WCF Federation binding on the MS side, and Axis2/Rampart/Rahas on the java side. Has anyone ever been able to make this work? 回答1: Axis2 is incomplete in

Implement callback C# functions for C++ DLL

牧云@^-^@ 提交于 2020-01-01 00:40:08
问题 I'm writing a DLL wrapper for my C++ library, to be called from C#. This wrapper should also have callback functions called from the library and implemented in C#. These functions have for instance std::vector<unsigned char> as output parameters. I don't know how to make this. How do I pass a buffer of unknown size from C# to C++ via a callback function? Let's take this example CallbackFunction FunctionImplementedInCSharp; void FunctionCalledFromLib(const std::vector<unsigned char>& input,

What exactly is the GNU tar ././@LongLink “trick”?

谁都会走 提交于 2019-12-31 12:50:02
问题 I read that a tar entry type of 'L' (76) is used by gnu tar and gnu-compliant tar utilities to indicate that the next entry in the archive has a "long" name. In this case the header block with the entry type of 'L' usually encodes the name ././@LongLink . My question is: where is the format of the next block described? The format of a tar archive is very simple: it is just a series of 512-byte blocks. In the normal case, each file in a tar archive is represented as a series of blocks. The

Register C# COM Object without having a real file for RegAsm

跟風遠走 提交于 2019-12-31 07:05:11
问题 I have a wierd application loading mechanism. I have a boostrapping exe file with all the other DLLs and the application itself inside it's resources. These files (assemblies) are extracted from resources and loaded ond emand because i'm attaching to the Assemblyresolve event of the current AppDomain. [STAThread] static void Main() { // if the command line contains extract then extract the dlls, next run will resolve assemblies from disk bool saveDllsToDisk = new List<string>(Environment

Passing a struct with a byte array inside to a interop-ed method

亡梦爱人 提交于 2019-12-31 05:38:08
问题 I have a situation where I have to pass a struct to a C method (declared as extern in my C# file). This struct however is quite complicated. I already used successfully the approach with AllocHGlobal, but I would like to understand if is possible to make it works in this way, by only passing a reference to the struct. [StructLayout(LayoutKind.Sequential)] struct lgLcdBitmapHeader { public Formats Format; } [StructLayout(LayoutKind.Explicit)] struct lgLcdBitmap { [FieldOffset(0)] public

COM->.NET - can't access overloaded method

百般思念 提交于 2019-12-31 03:50:22
问题 I'm trying to access a .Net library (The Image Resizer) from COM (jscript). I've tried both IDispatch and class interface generation, as well as [ClassInterface( ClassInterfaceType.AutoDual)] on the class in question. There is a method with 3 overloads: Bitmap Build(object, ResizeSettings settings) void Build(object source, object dest, string settings) void Build(object source, object dest, ResizeSettings settings) Calling Build("file",s); //works The following both generate "Wrong number of

Excel Interop - Cancel selection

∥☆過路亽.° 提交于 2019-12-31 02:42:07
问题 I'm copying and inserting rows in an Excel sheet, like so: while (rowsToAdd > 0) { // copy the existing row insertionCell.EntireRow.Copy(Type.Missing); // location of the new row Range newRow = insertionCell.EntireRow.get_Offset(1, 0).EntireRow; // insert the new row newRow.Insert(XlInsertShiftDirection.xlShiftDown, Type.Missing); rowsToAdd--; } The problem I have is that sometimes, I'm left with a selection marquee around the row I originally copied. Is there a way I can cancel the selection

WCF: Is using WsHttpBinding interoperable?

亡梦爱人 提交于 2019-12-31 00:44:16
问题 As the name states... right now I'm using BasicHttpBinding, but I'm wondering if I can switch to WSHttpBinding and still be interoperable with, for example, Java. 回答1: wsHttpBinding and the newer ws2007HttpBinding both implement WS-* standards. You may have to configure the details so that they interoperate with your specific clients. 回答2: WSHttpBinding offers a lot of interoperable features but in the same time it by default uses message security with Windows authentication, service

How do I declare an IStream in idl so visual studio maps it to s.w.interop.comtypes?

狂风中的少年 提交于 2019-12-30 12:20:31
问题 I have a COM object that takes needs to take a stream from a C# client and processes it. It would appear that I should use IStream. So I write my idl like below. Then I use MIDL to compile to a tlb, and compile up my solution, register it, and then add a reference to my library to a C# project. Visual Studio creates an IStream definition in my own library. How can I stop it from doing that, and get it to use the COMTypes IStream? It seems there would be one of 3 answers: add some import to

How to use WebDav to match dav:href to Outolook Interop href value

与世无争的帅哥 提交于 2019-12-30 11:42:21
问题 I have previously used webdav to access the sent messages on an exchange 2003 server based on the subject and time and this has worked. I now need to implement another feature which means dragging a message from client outlook (not web access) on to a windows form then querying webdav on exchange to get all the information about this message. I can get the messages href using the following code: Dim msg As MAPI.Message = CType(session.GetMessage(mail.EntryID), MAPI.Message) Dim id as string =