com

Passing a Safearray of custom types from C++ to C#

Hi, how can one use a Safearray to pass an array of custom types (a class containing only properties) from C++ to C#? Is using the VT_RECORD type the right way to do it? I am trying in the following way, but SafeArrayPutElement returns an error when trying to fill the safearray the reference to the array of classes gets to the managed ...

Saving webpage as MHTM file

Given a specific URL, I'm trying to download the contents of that URL as an MHT file. I considered writing a parser/crawler, but think there must be a quicker way. I fired up Powershell: $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://www.example.com") $ie.document.title # Just to verify the navigate worked ...

Can a Windows Server 2003 32-bit machine application work for a Windows Server 2008 64-bit machine?

I am using a Windows Server 2003 32-bit machine. Using that machine I have created a COM component and consumed it in another application and have an EXE file. Now I copy that EXE to another machine installed with Windows Server 2008, 64-bit. And when I try to run that EXE it shows something like "Debug Error: This application needs r...

DisconnectedContext was detected in LINQ To ActiveDirecory

Hi, I'm using LinqToActiveDirectory from codeplex and when I'm executing query using DirecotrySource I'm getting the following error: DisconnectedContext was detected Message: Context 0x3c5050' is disconnected. Releasing the interfaces from the current context (context 0x3c4f98).This may cause corruption or data loss. To avoid this pr...

Accessing classic asp (http)context from a .net wrapped with COM interface?

I don't know if it's possible, but suppose you want to handle reading/writing of cookies on a classic ASP page from a COM object. The COM object is written in .net and wrapped with a COM interface to make it accessible from classic ASP. For clarification - my question is this: Is it possible to access the ASP context inside a .net asse...

How to preview data from COM port with telnet or other windows tool

I would like to see what data come from COM serial port. Is it possible to do it with telnet or other windows tool? And if so, how to do it? ...

Can I stop COM from swallowing uncaught C++ exceptions in the callee process?

I am maintaining a project which uses inter-process COM with C++. At the top level of the callee functions there are try/catch statements directly before the return back through COM. The catch converts any C++ exceptions into custom error codes that are passed back to the caller through the COM layer. For the purpose of debugging I wa...

Registering my .net assembly for COM interoperability doesn't expose my methods.

Ok, I'm going crazy. I've been trying to make a simple .net assembly visible to use as a COM object but it's not working. I've been trying a lot of different aproaches but none of them work. So far the closest i've got is the one with the least amount of attributes, interfaces, manually registering etc. I have a vbscript as a test which...

Why do I get an InteropServices.COMException when attempting to launch QTP from C#?

This question is a follow-up to the one at http://stackoverflow.com/questions/895342/can-i-use-a-language-other-than-vbscript-to-programmatically-execute-qtp-tests. I have a C# (.Net 2.0) program which creates an instance of QuickTest.Application and launches QuickTest Professional (version 10.0). All my development testing worked well. ...

Can I display GUID in windbg?

I am trying to debug some COM components and want to track down CLSID and IIDs in calls to CoCreateInstance. I am not sure how to display GUID in windbg. Any pointers for that. ...

How to manage COM access in ASP.NET application

Hi, I have built ASP.NET app. I need to utilize a third party COM object SDK for managing documents. The application's name is "Interwoven". According to the COM object documentation you should "Never create more than one IManDMS object per application". So, I decided to create one instance of the IManDMS object and store it in an Appl...

CLR \ CLI Com Object Out of process Server.

How do you register a COM object written in Managed C++ to be SingleUse? Regasm does not appear to have the option. I am guessing it may be a s simple as defining an attribute in AssemblyInfo.cpp but I can't find it. I have written a VB6 ActiveX EXE and it works as I want it to - that is every request for an Interface creates a new runn...

hub4com source code

Anyone know where to find the source code for hub4com? i've got to read the contents of a com port and spit it out to 4 (or more) virtual com ports, so several apps can get the incomming data. ...

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

Javascript not loading in hosted web browser

We're in the unfortunate position of having to use a JavaScript control intended for a web page inside our Windows desktop application. To accomplish this, we host Internet Explorer inside our application and tell it to navigate to a local web page. We then get the IDispatch interface of the script engine and use it to interact with th...

ClearCase : list the content of a directory (ls) using CAL.

Hi; In ClearCase, you can list the content of a directory using "cleartool ls". My question is how can I do the same thing using CAL (ClearCase Automation Layer). The reason I prefer the COM API is because I won't have to parse the output of "ls". So far, I am able to get the VOB and the View successfully, but I didn't find any method...

COM event with binary data in arguments

I am trying to develop a COM object using C++ and ATL to be used by both C++ and C# Windows Mobile clients. The COM object wraps up all of the logic to connect to our server and send/receive data using our proprietary protocol. I am having some difficulty coming up with an OnReceive event that works correctly with C# and C++. I have d...

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

Trouble accessing functions of NetAPI32 wrapped in WCF that create users..

Hi stackers... I have created a project which is basically described as a consumable service to create or edit users on a remote computer. The idea is to connect to a server and add a user. The structure of the project is as follows: WCF Service: to expose functions to create/edit/select users Utility assembly: Netapi32 COM functions ...

C#: Regasm generating registry entries for every class in my COM DLL?

Hey everyone, I'm writing a class-library (IE BHO) in C# and currently wrangling with the large volume of what I think is junk output coming from REGASM's generated registry keys. The short version is this: I only want to expose a handful of classes (currently: ONE class) to IE (and the rest of COM). Only one class has the ClassInterf...