interop

Java ANSI X923 Padding

无人久伴 提交于 2019-12-06 11:55:42
问题 I have a new application written in java that needs to read encrypted values out of a db. The problem is that all the values in the db were encrypted by .NET code that uses the ANSI x923 padding scheme. I have done some research and it doesn't look like the Java TripleDes libraries have a way to specify this padding scheme. I was wondering if anyone knows if I am correct and the ANSI x923 isn't supported in java, or if there is a way to get this working. 回答1: If you use Bouncy Castle JCE, it

How do I expose a C++ method to my C# application?

佐手、 提交于 2019-12-06 11:50:19
问题 I am currently learning VC++. I have created an application that has functionality to block/allow IP addresses and I would like to expose this functionality to a C# application. I have defined the following members in my header file, which reference methods in my .cpp file which need to be accessible outside my application. public: // Constructor. ZizFilter(); // Destructor. ~ZizFilter(); BOOL StartFirewall(); BOOL StopFirewall(); BOOL AddIPAddressToBlockedList(char* IP) BOOL

communication between Java and C#

£可爱£侵袭症+ 提交于 2019-12-06 11:23:49
I found out that there is a .Net toolkit called GCT - Group Communication Toolkit that is the C# version of JGroup. I want to know whether this and JGroup can be connected together to make java and C# clients communicate with each other. If not, what would be the best option to make a java program and a C# program communicate? One other option I came across is XMPP implementation. I require very fast message passing between those two programs that are running in the same computer. The main requirement is that either of this program would send a message to the other, when some particular events

Writing C++ intended to be called from C#?

痞子三分冷 提交于 2019-12-06 11:12:28
So I am doing this as a learning moment and I'm not afraid to say I have no idea what I'm doing here. It might also be worth mentioning that I don't know much about C++ in this scenario. In C#, I've used DllImport plenty of times to bring in stuff from user32.dll or other DLLs that I haven't written, but I'm looking to better understand how the other half (the C++ half) is implemented to make this happen. The C++ code I have is simple and just to verify that the call went through successfully: #include <iostream> using namespace std; __declspec(dllexport) void HelloWorld() { cout << "Hello,

C++/cli -> calling c# dll -> calling OpenFileDialog issue

和自甴很熟 提交于 2019-12-06 11:06:08
问题 I write extensions to a C++ program. I write standard C/C++ dlls and I use IJW to call C# dlls. This has always worked perfectly until I wrote and called a C# dll that in turn called an OpenFileDialog and a SaveFileDialog. Whenever either was called with ShowDialog, the app would freeze. So in making a "Minimum Working Example" I got an: An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll Additional information: Current thread must be

how to detect Empty paragraph in Word Document using Microsoft.Office.Interop.Word in C#4.0?

蓝咒 提交于 2019-12-06 10:48:50
问题 I want to detect Empty paragraphs in Word Document using Microsoft.Office.Interop.Word. Suppose, if my word document have some empty paragraphs,then Assume paragraph 3 is an empty paragraph... Microsoft.Office.Interop.Word.Paragraph para = wordDoc.Content.Paragraphs[3]; int cSent = para.Range.Sentences.Count; for (int j = 1; j <= cSent; j++) { Microsoft.Office.Interop.Word.Range sent = para.Range.Sentences[j]; MessageBox.Show("Sent lines :" + sent.Text.ToString()); } Then empty paragraphs has

Weird scrollbar UI in hosted WPF composite control

ε祈祈猫儿з 提交于 2019-12-06 10:32:29
My windows forms application hosts AvalonEdit (the composite WPF control in question) in one of its forms to cater to its text editing requirements. Here's the code I use: WPFHost = gcnew ElementHost(); TextField = gcnew AvalonEdit::TextEditor(); WPFHost->Dock = DockStyle::Fill; WPFHost->Child = TextField; TextField->Options->AllowScrollBelowDocument = false; TextField->Options->EnableEmailHyperlinks = false; TextField->Options->EnableHyperlinks = true; TextField->Options->RequireControlModifierForHyperlinkClick = true; TextField->ShowLineNumbers = true; ContainerControl->Controls->Add(WPFHost

FilePut does not prepend the two length bytes when writing a string to a binary file from C#. FilePutObject throws exceptions on classes/structs

核能气质少年 提交于 2019-12-06 10:04:21
I have a app that needs to be both read and write compatible with a VB6 binary file. I learned about the Microsoft.VisualBasic.FileSystem class and I am trying to write out a structure to the file. FileSystem.FileOpen(file, "test.bin", Microsoft.VisualBasic.OpenMode.Binary); FileSystem.FilePut(file, patch.intTest); FileSystem.FilePut(file, patch.dateTest); FileSystem.FilePut(file, patch.stringTest, StringIsFixedLength: false); FileSystem.FilePut(file, patch.boolTest); Everything writes correctly if I put each item individually except the string. When the VB6 app writes the string it prepends

C++/CLI noob: System.AccessViolationException

倾然丶 夕夏残阳落幕 提交于 2019-12-06 09:50:41
I'm trying to put together a "cool demo" for a career day at my daughter's jr. high in 5 days and so I'm trying to use the echoprint library to perform over the air (OTA) audio recognition. I've never really gone much farther than "hello world" in C++ and I am trying to use C++/CLI to wrap the echoprint codegen library so I can call it from C#. Here's my header file: // echoprint-cli.h #pragma once #include "Codegen.h"; using namespace System; namespace echoprintcli { public ref class CodegenCLI { public: String^ getCodeString(array<float>^ buffer, unsigned int samples, int start_offset); }; }

Dart SDK 0.8.10.3_r29803 dart:js callbacks

孤街醉人 提交于 2019-12-06 09:46:01
Can some one please give me an example of the Dart code that would follow this flow 1) Dart call Javascript function 2) Javascript loads some data via Javascript api's 3) Javascript returns data to Dart Currently I can only call the Javascript function I need (via js.context.callMethod('myAmazingFunction');) but I can't receive the callback. I thought there would be something like js.context.listenForMethod('myAmazingCallback'); or similar... Just pass your Dart function into JavaScript and it'll automatically converted to a JavaScript function. Dart: import 'dart:js'; myCallback(data) { print