interop

From VB6 to .net via COM and Remoting...What a mess!

I have some legacy vb6 applications that need to talk to my .Net engine application. The engine provides an interface that can be connected to via .net Remoting. Now I have a stub class library that wraps all of the types that the interface exposes. The purpose of this stub is to translate my .net types into COM-friendly types. When I r...

Calling a running C# application from VBA

I have some VBA code that needs to talk to a running c# application. For what it's worth, the c# application runs as a service, and exposes an interface via .net remoting. I posted a question regarding a specific problem I'm having already (http://stackoverflow.com/questions/2556163/from-vb6-to-net-via-com-and-remoting-what-a-mess) but ...

Running a server control inside an MVC view page? (asp.net)

Is this possible? if so, what adjustements do i need to make in order to do this properly. I know i can run webforms and mvc views in seperate files, but i want to run the web server control output and events in/on the mvc view page, however, i keep getting this compiler error: Line 38: <CuteWebUI:Uploader ID="UploadPic" runat="serv...

Unmanaged C++ in .net

Hi, can someone please tell why , Great Microsoft that created C# language and now we're in C# 4.0 , dont have an important feature that C++\CLI has !!,which is to directly compile and link with un-managed c++ ?? ...

How to write an altered COM Structured Storage file to Disk?

I have a COM Structured Storage File reader implemented that can open Storage and stream objects, that's all happy. But now I want to be able to copy things from one archive to another and rename things and then write things back to the disk. I haven't even adressed the copy and rename operations because I can't seem to even write chan...

Using Bitmap.LockBits and Marshal.Copy in IronPython not changing image as expected

Hi all, I have written the following IronPython code: import clr clr.AddReference("System.Drawing") from System import * from System.Drawing import * from System.Drawing.Imaging import * def NoWorko(bitmap): bmData = bitmap.LockBits(Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadWrite, PixelFormat.Format2...

How to easily pass a very long string to a worker process under Windows?

My native C++ Win32 program spawns a worker process and needs to pass a huge configuration string to it. Currently it just passes the string as a command line to CreateProcess(). The problem is the string is getting longer and now it doesn't fit into the 32K characters limitation imposed by Windows. Of course I could do something like c...

C# Interop with dll

Using VS2008 C# am attempting to interop a C++ dll. Have a C++ class constructor: make_summarizer(const char* rdir, const char* lic, const char* key); Need to retain a reference to the object that is created so I can use it in a follow-on function. When I did this in JNI the c code was: declare a static pointer to the object: sta...

How do i transfer this unmanaged code from asp to asp.net 2/mvc?

hi guys, i'm a newbie to ASP.net interop features, so what i have right here is some unmanaged dll that i need to call from my asp.net mvc app. the dll name is CTSerialNumChecksum.dll. i can easily call the dll from asp using just those two lines below and from my trusty response. write everything is working fine. set CheckSumObj = Ser...

Call any Java method from C#

Is there a way using JNI and C# code to create a program that invoke any given Java method? Assume that I have a jar containing classes hierarchy and I'm responsible for loading the JVM and these classes, can I write a C# program that receives the java method signature + arguments values on the fly and call the java code? Please try to ...

Strange dumpbin export table

Am interoping a c++ dll and am attempting to access it's functions. Below is the dumpbin /exports output from the dll: Dump of file C:\C#Processes\SummarizerApp\SummarizerApp\lib\summarizer37.dll File Type: DLL Section contains the following exports for summarizer37.dll 00000000 characteristics 458962FF time date stamp Wed Dec 20 11:21...

How do I get a java application to subscribe to an NServiceBus publisher?

I've asked Google and searched through the NServiceBus website and forums, but I can't seem to find any prescriptive guidance on how I would write a Java application to subscribe to a publisher. Does anyone have any such link or experience? ...

Marshal generic return types for com interop

Is it possible to Marshal a generic return type as non-generic for COM interop? Let's say I have the following class: [ComVisible(true)] public class Foo { public IEnumerable<string> GetStr() // Generic return type { yield break; } } I know that IEnumerable<string> implements IEnumerable. Can I force tlbexp.exe (...

Using VSTO in a standalone application to access Excel sheets

Dear all, tried to research on that but sometimes I seem to lack some googling skills... I want to develop a (standalone) WinForms application which uses automation for communicating with Excel. I already know how to use the Interop, but I thought the VSTO tools would provide a more comfortable or sophisticated way to do that. My idea...

Excel Interop's get_printquality method - what the heck?

I'm using C# and the Office 2007 Excel Interop library. I'm needing to adjust the print quality of every page on each worksheet in an Excel file using the Interop API. The following is my current code for doing this. This is happening within a foreach loop over every Worksheet in the Workbook. // Attempt to force the printer to...

Interop Structure: Should Unsigned Short be Mapped to byte[]?

I have such a C++ structure: typedef struct _FILE_OP_BLOCK { unsigned short fid; // objective file ID unsigned short offset; // operating offset unsigned char len; // buffer length(update) ...

Exposing a C++ API to C#

So what I have is a C++ API contained within a *.dll and I want to use a C# application to call methods within the API. So far I have created a C++ / CLR project that includes the native C++ API and managed to create a "bridge" class that looks a bit like the following: // ManagedBridge.h #include <CoreAPI.h> using namespace __CORE_API...

.NET Excel Interop - Why aren't my Footers displaying in my printed output file?

I'm working with C# and Office 2007's Excel Interop API. I'm opening an Excel file, applying some formatting and then sending it to the printer. I've got a problem, though. The Footer text doesn't appear to be printing. If I check the PageSetup.RightFooter property, I can see the expected Page Number in the Footer. That Page Number does...

Excel.Range.Find method

I am using Excel interop object and trying to find a date in a specified range by below method Excel.Range rngFind = WS.get_Range(strFromRange, strToRange).Find(strFind, Type.Missing, Excel.XlFindLookIn.xlFormulas, Excel.XlLookAt.xlPart, Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, false,...

PowerPoint record slide show function accessible through Interop with C#

I am currently trying to write an addin for PowerPoint that whenever any PowerPoint document is opened and then run in show mode that the feature to record narration audio and slide timings is automatically activated. However I cannot seem to find that option in the PowerPoint interop object The manual in application way to use this fe...