interop

Getting the word during mousemove and checking if its a link

I am creating a user control derived from RichTextBox. I have to display a tooltip under a custom hyperlink I have created the cusom hyperlink ,with CFM_LINK . Now when I do a mouse hover on the link , a tooltip should be displayed , with values respective to the link . "I am using [Word2003] , but [Word2007] is the recent version. "...

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

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 me...

c# p/invoke difficulties marshalling pointers

I am attempting to call into a native .dll from c# using p/invoke. I'm able to make the call (no crash, the function returns a value), but the return code indicates "A pointer parameter does not point to accessible memory." I've resorted to trial and error in order to solve this, but I haven't made any progress so far. Here's the sig...

Asp.net C# Fileupload and Access Interaction

I'm building a webapp that needs to interact with a Access Database. The Access database is about 200 megs and I don't want to upload the entire thing...just the contents of one table. So far, I've used Microsoft.Office.Interop.Access in the past on a desktop app but when I tried this on a webapp there is some cryptic permission issues...

From C++ wchar_t to C# char via socket

I am currently building a C++ application that communicate via socket to a C# application. My C++ app sends wchar_t* via socket. Here is an overview of what is send : <!-- Normal xml file-- Here is what I receive on the other side (I do a stream.read to a byte array and use UTF8Encoding.GetString() to convert the byte array to a read...

C# P/Invoke: How to achieve double indirection for a field of a structured parameter

I am calling into a native dll from C#. For the specific function in question, one of the parameters I need is a structure which contains a doubly-indirect field (pointer to a pointer). For example, take the following C prototype and structs: int someFunc(SomeStruct* result); struct SomeStruct { DWORD foo; AnotherStruct** p...

Marshalling a Linked List

Apologies for duplicate posting. Hi I am having trouble marshalling a linked list from a DLL. ------C++ Structure and Function-------- struct localeInfo { WCHAR countryName[BUFFER_SIZE]; WCHAR localeName[BUFFER_SIZE]; localeInfo *next; } int GetSystemLocales(localeInfo **ppList); -----------C# Declarations----------- ...

C# + COM Interop, deterministic release

COM objects usually have deterministic destruction: they are freed when the last reference is released. How is this handled in C# - COM Interop? The classes don't implement IDisposable, so I see no way to trigger an explicit IUnknown::Release. A casual test shows that unreferenced COM objects get collected lazily (i.e. the garbage col...

In VB6, how do I call a COM object requiring a pointer to an object?

Hi, I'm having trouble with a .NET Assembly that is com visible, and calling certain methods from VB6. What I have found is that if the parameters are well defined types, (e.g. string), calls work fine. If they are higher level objects, it raises a runtime error '438' suggesting that the property or method is not present. I suspect tha...

VB6 .NET interop issue in Vista

I wrote an assembly in C# and I needed to invoke a method on the DLL from a VB6.0 application. I made the DLL COM compliant and registered the DLL accordingly. From my VB application I would then instantiate the class in the .NET assembly using the VB6.0 CreateObject method. Set dotNetObj = CreateObject("Namespace.ClassName") I would ...

WPF, Flash and Airspace

Has anyone been able to solve the airspace issues when trying to play a flash (swf) movie in a WPF application? I've been able to play the swf file using a WinForms control and a WindowsFormsHost element, and also using the WebBrowser element - but both have the airspace issues. ...

Problem with handling COM events in VB.NET

I'm calling the SQLDMO 8.0 COM library from VB.NET (using a PIA I generated with tlbimp) in order to backup a database with percentage completion notification: Dim server As SQLDMO.SQLServer = Nothing Dim backup As SQLDMO.Backup = Nothing Dim restore As SQLDMO.Restore = Nothing Dim backupAbortable As Boolean Dim restoreAbortable As Bool...

Excel Object in asp.net

Hi I have a serious issue. I am using excel object for opening the excel file it works fine i my PC. when i make application as a website and running the page and uploading it gives the error "'C:\Documents and Settings\Administrator\Desktop\Work\SABRE MSO Mapping Request Template.xlsx' could not be found. Check the spelling of the file ...

Repeat windows messages in Winforms

I want repeat sent windows messages to my winforms application. Now, I have class implementing "IMessageFilter" which saves the selected messages (WM _KEYDOWN, WM _LBUTTONDOWN, etc...) to the list. On key "Pause/Break" I copy the list of messages, clear original list, and resend the messages. In my test project is only one form with on...

Excel Interop Conditional Formatting

I've just spotted the following page: Setting Conditional Formatting in Excel 2007 which is very similar to something I'd like to do, but I can't seem to find appropriate functions to do something slightly different. I'm wondering if anyone knows a way to apply conditional formatting to a range, based upon a set of textual values. E.g. ...

How do I get the ProgID of a COM component from C#?

I have an application that is written in C# I want to display a list of COM components in a folder on the system with details about the component, initially the ProgID. Is there a way of interrogating a component from my C# code to find out the details at runtime. ...

How do I handle a failed DllImport?

I'm attempting to write a C# managed class to wrap SHGetKnownFolderPath, so far it works on Vista, but crashes on XP due to not finding the proper function in shell32.dll, as expected. I want to have it set so I can fallback on a (admittedly hacky) solution using System.Environment.GetFolderPath if using XP. (Or, even better, if it can'...

What are my options for C++ DLL to call a C# DLL?

I have a C++ DLL that needs to call a function (pass a value, return a value) in a C# class library. Is my only option to give the C# DLL a COM interface and call it from C++ with IDispatch? Is this the best method? ...

COMException Breakdown

Does anyone know if a site (even non-Microsoft), that has details on COMExceptions/HRESULTS. When I attempted to Save my Excel Workbook after using the Copy() function, I received this error: ERROR - Unable to SaveWorkbook() System.Runtime.InteropServices.COMException (0x800A03EC): Document not saved. P.S. I'm doing this in a tight ...

Return byte array from C# to VBScript via COM interop

Hey all, I have C# method that returns a byte array I want to be able to access from VBScript. More or less: namespace ClassLibrary7 { [ClassInterface(ClassInterfaceType.AutoDual)] [Guid("63A77D29-DB8C-4733-91B6-3CC9C2D1340E")] [ComVisible(true)] public class Class1 { public void Create( out byte...