interop

PInvoke CreateDesktop

Hi, I am trying to PInvoke CreateDesktop in a way that passes the flag to inherit the desktop by child processes. The declaration is as follows: [DllImport("user32", EntryPoint = "CreateDesktopW", CharSet = CharSet.Unicode, SetLastError = true)] public static extern IntPtr CreateDesktop(string lpszDesktop, IntPtr lpszDevice, In...

Calling .NET assembly using Xslt from Delphi 5 Win32 assembly.

This is my first attempt to call a .NET assembly from a Delphi 5 (Win32) native assembly. I am only familiar with C# and .NET so please bear with me. I guess I will walk thru this layer by layer. Here is the code for the C# assembly I am attempting to execute from the Delphi 5 assembly. using System; using System.Collections.Generic; us...

Need of ClassInterfaceType.None?

Didn't quite get the following from MSDN: ClassInterfaceType.None Indicates that no class interface is generated for the class. If no interfaces are implemented explicitly, the class can only provide late-bound access through the IDispatch interface. This is the recommended setting for ClassInterfaceAttribute. Usi...

Validate java SAML signature from C#

How can i validate in .Net C# a SAML signature created in Java? Here is the SAML Signature that i get from Java: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt; <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt; </ds:CanonicalizationMethod> <ds...

What is IViewObject and How is it Used in C#

I'm trying to do a few internet explorer automation tasks and it's requiring me to use IViewObject. What is IViewObject? Where can I find it's definition? I've been google-ing and everything I find has a different interface definition for IViewObject. Different methods or different parameters going into the same methods. How do I know ...

DllImport Instance Duration

Within asp.net, if I call a dll using DLLImport, does anyone know the scope of that instance? Is it at application level, so any subsequent calls go to the same instance of the dll until the application ends? I've got a dll where I need to pre-load some data into the dll and was wondering wether I should do this in application start, an...

Programmatic Integrity Check Creating False Positives

I created an application that automates some of the mundane tasks of using business objects designer. One of the tasks it performs is documenting a universe after creation, and recording the documentation to an HTML file. The problem I'm having is that (many times) I'll create a universe, run an integrity check on it, and find no errors...

classes or wrapper for working with dde in .net?

Can anyone point me to classes or wrapper to use when working with DDE in .NET? yeah yeah, I know it's supposed to be obselete etc etc :) Just sometimes necessary to work with. ...

Starting a new Outlook 2007 Message from C# .NET

Hello, I'm looking for the most barebones complete example, to launch Outlook 2007 with a new message started via C# .NET (I happen to be using VS2008 .NET 3.0) Here's what I'm trying: using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Interop.Outlook; namespace CreateMessage { class Progra...

Form load Event fires twice, using Interop Forms Toolkit

I've been following a codeproject article on using the interop forms toolkit (basically a way for developers to slowly upgrade their VB6 projects to .net by allowing .net components run in VB6) http://www.codeproject.com/KB/vb-interop/VB6InteropToolkit2.aspx While the .NET form is working fine in all other testing projects and environm...

List columns in a SSIS Flat File Connection

I'm trying to produce a column 'start/length' spec document from a SSIS package that exports a DB table to a flat file. I have hit something of a brick wall in getting the Columns property from the ConnectionManager object that handles the flat file connection. I am able to get the Columns property, but I cannot do anything with it, as...

CUDA global memory deallocation issues in .NET

I have a class (see example bellow) which acts as a .NET wrapper for a CUDA memory structure, allocated using cudaMalloc() and referenced using a member field of type IntPtr. (The class uses DllImport of a native C DLL which wraps various CUDA functionality.) The dispose methods checks if the pointer is IntPtr.Zero and if not calls cuda...

What parts of a Java application should be written in Scala?

I'm writing a Java application using Struts 2, but now I'd like to make it a hybrid Java & Scala project instead. I don't have much experience with Scala, but I learned Haskell years ago at college -- I really liked the functional programmed paradigm, but of course in class we were only given problems that were supremely suited to a func...

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I'm getting this error when I'm using COM reference in winform. I tried using Window Media Player COM in winform and it's working fine. But I got this error when I tried using with other COM dll. I tried "regsvr32" to that COM dll but it was successfully registered but I'm still getting this error when I run my winform that is using th...

C#: marshalling a struct that contains arrays

I am doing some C# interop work. I have the following struct: #pragma pack(push,1) typedef struct { unsigned __int64 Handle; LinkType_t Type; LinkState_t State; unsigned __int64 Settings; signed __int8 Name[MAX_LINK_NAME]; unsigned __int8 DeviceInfo[MAX_LINK_DEVINFO]; unsigned __int8 Reserved[40]; } LinkInfo_...

How do you manage generated code in Visual Studio - in particular, creating DLLs from .idls.

I'm trying to add a generated COM interop assembly project to my solution, and the only solution I could come up with feels really nasty. I created a .net dll project, removed all .cs files from it and then created the following post-build event: call "$(DevEnvDir)..\tools\vsvars32.bat" midl.exe $(ProjectDir)relative-path-to-my-idl\MyC...

C# Com Retrieving binary Image (Tiff) Data from device

I am trying to retrieve Tiff image data through COM using a StringBuilder but the buffer only has a length of 3 after the COM call. I am converting a VB.NET version to C# which uses a String instead of StringBuilder and is working just fine. If anyone has any suggestions or can point me to some good reading material I would appreciate ...

C# - way to programmatically advance Powerpoint slide show?

Hi, I'd like to be able to advance through a Powerpoint presentation by pressing buttons in a Windows form. Here's some code I've found from http://bytes.com/topic/c-sharp/answers/272940-open-powerpoint-presentation-c-window-form that opens a Powerpoint presentation slide show: Microsoft.Office.Interop.PowerPoint.Application oPPT; Micr...

Executing VBSCript in COM dll using .Net and Interop

I have a VB6 application that I am converting to .Net in phases. The current phase requires .net to make a call to a VB6 dll through interop to execute VBScript using the MS Script control. Other than the process being "convoluted" are there any known issues with this setup? Sometimes nothing is executed or I get an error "Attempted to...

Documentation for implementors of COM interfaces

I'm in the process of doing some COM interop from a C# application and I can't seem to find the answer to this. I was wondering where I could find in the Win32 documentation which concreate implementions that exists of a COM interface. For example I know (thanks to goodgle) that IShellLinkW is implemented by a class that's identified by...