interop

Is it possible to share code between a Silverlight web app and Windows Phone 7 app

喜欢而已 提交于 2019-12-05 19:21:05
I have a simple Silverlight app that I want to run on Windows Phone 7 almost exactly as is. I've created a new Windows Phone 7 project and when I reference the Silverlight app I get a warning that says "Adding a reference to a Silverlight project might not work properly. Do you want to continue?". If I continue and try to run anyway, the WP7 project never starts or sometimes I get "AG_E_PARSER_BAD_TYPE error" and it points to the line in the xaml I used a control from the Silverlight project . The code between these two projects is about 99% the same. Is there another way to reuse code then

Scala trouble accessing Java methods

試著忘記壹切 提交于 2019-12-05 18:42:29
So, I have something written in Java, and I want to extend it in Scala... The issue I'm running into is that Scala isn't seeing methods I need. Here is how it's set up: Player extends Mob, and Mob extends Entity. I need to access a method in Player that isn't defined in Mob or Entity, but Scala doesn't think it exists even though Java does. It can see methods defined by Mob and Entity just fine. Also, all the methods I'm talking about are non-static. So, am I doing something wrong, or is this a limitation imposed by Scala? Edit -- Here is the relevant code: package test import rsca.gs.model

How to get the installation directory in C# after deploying dll's

*爱你&永不变心* 提交于 2019-12-05 18:39:40
问题 Is there some smart way to retreive the installation path when working within a dll (C#) which will be called from an application in a different folder? I'm developing an add-in for an application. My add-in is written in C#. The application that will use is written in C and needs to compile some stuff during evaluation, so I have a middlestep with a C++ dll that handles the interop business with C# and only shows a clean interface outward that C can work with. What I deploy will be a set of

Is it possible to use OCaml in embedded mode?

五迷三道 提交于 2019-12-05 18:14:47
Some time ago I emerged for myself that Guile and Racket can be embedded and be called right from any C++ application. Can OCaml work like this? You can have a look at the Embedded O'Caml Toplevel done by Clément Capel. It's the result of a summer internship so it wasn't updated since 2004. Otherwise, there is ocamlmklib . You can use the OCaml toplevel as a library. It is part of the official OCaml distribution and up-to-date. See toploop.mli in OCaml sources for the interface. It is officially only available in bytecode, but there is experimental support for native code. If you plan to

COM returns type that does not implement any interface

孤街浪徒 提交于 2019-12-05 17:55:58
I need to automate some tasks in Adobe InDesign CS3 from a .NET 4.0 application. I've added a reference to the InDesign Type Library using the Add Reference dialog in Visual Studio. It genereates an interop assembly, which correctly includes all of the interfaces and types declared in the type library. I haven't installed any Adobe SDK, as the type library was available in Visual Studio without installing anything but Adobe InDesign CS3. The interesting types in the interop assembly for me right now is the interfaces _Application and Application , and the class ApplicationClass . Here is the

.NET interop in PowerBuilder

匆匆过客 提交于 2019-12-05 15:16:30
I'm looking for a way to do two-way communication between a PB object and a .NET (C#) object. In looking at Brad's .NET version of his GUI controls, I see how to give the .NET object a reference to the PB object. But in that example, it's cast as a PowerObject (basically). That C# code only calls TriggerEvent() on the PB object. I want to create a custom class in C# called foo1. I want to create a method on foo1 called bar1(). I want to create a custom class in PB called foo2. I want to create a method on foo2 called bar2(). I want to be able to create an instance of foo1 within foo2. I want

How can I deterministically dispose of a managed C++/CLI object from C#?

落爺英雄遲暮 提交于 2019-12-05 14:36:00
问题 I have a managed object in a C++/CLI assembly. Being C++/CLI, it implements the Disposable pattern through its "destructor" (yes, I'm aware it's not the same as a standard C++ destructor). From C++/CLI, I would simply delete the object. However, I am using this object as a member variable in a C# class. From my C# class, then, I would like to call the equivalent of the Dispose() method on the C++/CLI object when I am finished using it. Since it is (and must be) a member variable of the class,

How can I get the outlook contact's avatar image?

ε祈祈猫儿з 提交于 2019-12-05 14:24:05
I am trying to get the contact's avatar image. using Microsoft.Office.Interop.Outlook; public sealed class OutlookAvatarFetcher { private static void FetchAvatars() { var outlook = new Application(); var folder = outlook.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderContacts); var items = folder.Items; for (var i = 0; i < items.Count; ++i) { var contact = items[i + 1] as ContactItem; if (contact == null) continue; if (contact.HasPicture) { // TODO store the picture somehow. } } } } But unfortunately I can't find a picture accessor. You can use the attachments property of the

Exception on native thread crashes .Net application without exception

半腔热情 提交于 2019-12-05 14:00:38
I have discovered a scenario where my .Net application will crash unexpectedly without raising any exceptions. I would like that, at least, AppDomain.UnhandledException worked in this case, in order to enable me at least to log the error and present the user with some information. In this scenario, I have an .Net assembly (let's call it A ) with an interop call to a native DLL (which we will call B ). B creates a thread and throws; Without anyone to catch the exception, I'd expect it to go all the way up the stack, back into my managed application, and then finally become an unhandled

Attach to existing Excel Instance

穿精又带淫゛_ 提交于 2019-12-05 13:45:55
I'm trying to determine whether or not an instance of Excel of running with a particular file open, and if so attach to it so I can control that instance. I've searched around and the majority of what I've got have come from this question. It has a reference to another site , but unfortunately it's dead for me so I cannot read up on it. My code so far is; //Is Excel open? if (Process.GetProcessesByName("EXCEL").Length != 0) { Process[] processes = Process.GetProcesses(); foreach (Process process in processes) { //Find the exact Excel instance if (process.ProcessName.ToString() == "EXCEL" &&