interop

Can Java apps integrate with VB apps?

I am not sure exactly what I am asking....The guys that do the software development for the company I work for write everything in VB. I am currently the Web developer for this company and I specialize in Flex apps. I am thinking about expanding into their area. But I do not want to do VB, I don't mean to bash on VB but the coding syntax...

What are the troubleshooting steps/tools for C# to Native interop?

I have an SDK that is written primarily in C#. We have some native code that was written for security and performance reasons. We use DllImport to interop with the native code. There are a few functions that I get an "Unable to find an entry point named '...' in DLL '...'.":"" error. I have verified that the function that is not foun...

Unable to get window handle, Windowless ActiveX controls are not supported?

I upgraded my development machine to Windows 7 and my project to .NET 3.5. When I try to run the project, I now get this error: Unable to get the window handle for the 'AxVt' control. Windowless ActiveX controls are not supported. The project is using the Dart Emulation for ActiveX Vt control, which emulates a terminal control. I doub...

How to pass a class object from Scala to Java?

I'm trying to use a Java class library from Scala code. (JGraphT, to be precise.) One of the constructors I need to call is public class SimpleGraph<V, E> extends AbstractBaseGraph<V, E> implements UndirectedGraph<V, E> { public SimpleGraph(Class<? extends E> edgeClass) {...} } To call this from Java, I would say: Undirec...

Using a C++ class member function as a C callback function

I have a C library that needs a callback function to be registered to customize some processing. Type of the callback function is int a(int *, int *). I am writing C++ code similar to the following and try to register a C++ class function as the callback function: class A { public: A(); ~A(); int e(int *k, int *j); }; A::A(...

WPF Interop & Dialogs

I have an existing WinForms application for which I'm now designing new bits in WPF. Things are going reasonably well and I have run into my first need for a dialog. I'd like to do the dialog in WPF. It appears as though I'm going to need to do a UserControl for the actual content and then host that content via a WinForms form with an...

range : apply formatting to a sub section in the range.

I'm writing a piece of code in c# to generate a report in microsft word document. I have a table of wid 2 columns. I select the 2nd column by oMainTable.Cell(currentRowNumber, 2).Range Every time I have to write something in that cell I use the above code with the combination of the Text property ,InsertParagraph(),InsertAfter() etc ...

Drag drop html table in powerpoint 2007

Hello... i've been dealing with this problem for quite a while: Our company develops addins for word/excel/ppt (both for 2003 and 2007 versions) One of the options our addins offer is to drag a table from the addin into the application. This is implemented in 3 different ways: Excel --> we create a tab delimeted string and drag-drop...

Can't instantiate COM component in C# - error 80070002

I'm attempting to instantiate a Windows Media Player COM object on my machine: Guid mediaPlayerClassId = new Guid("47ac3c2f-7033-4d47-ae81-9c94e566c4cc"); Type mediaPlayerType = Type.GetTypeFromCLSID(mediaPlayerClassId); Activator.CreateInstance(mediaPlayerType); // <-- this line throws When executing that last line, I get the followi...

interoperatability Cpluspluss_CLI_ManagedArray <--> Array

Hello There, How can i convert interoperatability between a c++/CLI Array and a native c++ array AND VICE VERSA. array^ Cpluspluss_CLI_ManagedArray; unsigned char* UnmanagedArray; I found the System::Runtime::InteropServices::Marshal; (IntPtr) there is so much of information for a first timer like me (to CLI) So I'm not sure about wh...

Creating COM extension using C# - is it worth it?

I'm dealing with the following issue: a (third-party) software (Software A ) we are using extensively allows the programming of what it calls 'extensions' using a Component Object Model (COM) interface (actually several interfaces). It provides the MIDL files for these interfaces as well as a 'project template' for Visual C++ as part of ...

array<Byte>^ TO unsigned char* :: Marshall class - Interop Issue

Hi, I wanted to convert array< Byte>^ to unsigned char*. I have tried to explain what i have done. I donot know how to proceed further. Please show me the right approach. I am using MS VC 2005. //Managed array array<Byte>^ vPublicKey = vX509->GetPublicKey(); //Unmanaged array unsigned char vUnmanagedPublicKey[MAX_PUBLIC_KE...

How can I create a c# object from C code?

I'm using a small C webserver. I'm doing some of the actual request processing with C# libraries. I'm using a glue layer which appears to be written in something close to c++ to join the two worlds. It provides a 'public ref class' which I can derive from in the C# world. If I want to derive several different classes from this in C#, h...

Is there a way for registration free activation of COM componets.

IS there a way to activate a COM component which is EXE COM application and also it's dependent COM dlls? I want to activate this COM component from .NET application(VS 2005/VS 2008). the path of call is C# application --> invoking out-of-proc exe(this is through COM) and then this out-of-proc invokes few COM dlls ...

How do I add .Net controls to a vb6 application dynamically.

I work on an application which is extendable using VBScript. I have access to the VB6 form and can add controls and reference other controls on the form. I am also able to launch .Net forms via interop. What I would like to be able to do is to create a reference to a .Net component and hand it a reference to a VB6 Frame or SSTab and t...

Using a COM dll from C# without a type library

I need to use a COM component (a dll) developed in Delphi ages ago. The problem is: the dll does not contain a type library... and every interop feature (eg. TlbImp) in .NET seem to rely on TLBs. The component has been used in Delphi programs here for many years without problems because "It's not much of a problem using COM objects from ...

What is "ShowWindow Lib "user32" " about?

I was looking over some code that another developer wrote and found this: Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer Private Declare Function SetForegroundWindow Lib "user32" (ByVal handle As IntPtr) As Integer What does it do and what is it for? ...

Calling C++ function from C#

Hello, I have a the following C++ function void FillAndReturnString(char ** someString) { char sourceString[] = "test"; *someString = new char[5]; memcpy(*someString, sourceString, 5); } It is declared as extern "C" { __declspec(dllexport) void __cdecl FillAndReturnString(char ** someString); } How do I call this func...

C# interop - validate object exists

I would like to use a COM object in my application. How can I make sure the object is registered in the machine? The only solution I found (also on SO) was to use a try-catch block around the initialization: try { Foo.Bar COM_oObject = new Foo.Bar(); } catch (Exception ee) { // Something went wrong during init of COM object }...

Calling back to VBScript from C#

Hi, I'd liked to know whether it is possible to call a function in VBScript from C#. Let me try to clarify. I'm using an application (Quick Test Professional or "QTP") that automates another application, mostly using VBScript. There is the ability, via an add in model, to extend the test functionality by writing add-ins to the testing...