com

Not getting event arguments in IHTMLElement event handler

I've added a callback to an IHTMLElement instance but when the IDispatch::Invoke is called for the event, there are never any arguments (i.e. the pDispParams->cArgs and pDispParams->cNamedArgs are always 0). For example, I add a callback for an onmouseup event. From what I can tell, a callback for this event is supposed to receive a Mous...

Advice on mixing legacy ASP site with .NET 2.0

We've just been tasked with updating an e-commerce application to use PayPal's PayFlow product. The site was originally written in classic ASP except for the credit card processing portion which was a COM component. Our plan is to replace the COM component with a .NET 2.0 component. I'm looking for tips, gotcha, etc. before we embark....

Is there a faster way of getting a char* from a _variant_t than (const char*)(_bstr_t)

Here's the code I want to speed up. It's getting a value from an ADO recordset and converting it to a char*. But this is slow. Can I skip the creation of the _bstr_t? _variant_t var = pRs->Fields->GetItem(i)->GetValue(); if (V_VT(&var) == VT_BSTR) { char* p = (c...

IDL enumeration not displayed in type library

I have a COM object written using the MS ATL library. I have declared a bunch of enumerations in the IDL but they do NOT appear when viewing the type library using the MS COM Object Viewer tool. The problem seems to be that the missing enums are not actually used as parameters by any of the COM methods - how can I force these enums to ...

How can I debug a C# COM assembly when it's being called from a native win32 application?

I'm developing a C# assembly which is to be called via COM from a Delphi 7 (iow, native win32, not .net) application. So far, it seems to work. I've exported a TLB file, imported that into my Delphi project, and I can create my C# object and call its functions. So that's great, but soon I'm going to really want to use Visual Studio to ...

How to UAC elevate a COM component with .NET

I've found an article on how to elevate a COM object written in C++ by calling CoCreateInstanceAsAdmin. But what I have not been able to find or do, is a way to implement a component of my .NET (c#) application as a COM object and then call into that object to execute the tasks which need UAC elevation. MSDN documents this as the admin ...

Could you explain STA and MTA?

I'm having trouble understanding STA and MTA. If you could explain it in your own words that would be great. Also what are Apartment threads and do they pertain only to COM? If so why? ...

How to write a class library for OLE Automation?

I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite. I ported the add-in to Visual Studio as a class library project but Excel Automation doesn't recognize the classes in the compiled ....

How do I write a working IThumbnailProvider for Windows Vista

I have written a thumbnail provider following the interfaces specified on MSDN. However, I have been unable to figure out how to register it in a way that Vista actually calls into it. Has anyone gotten a thumbnail provider working for Vista? Sample code or links would be especially helpful. ...

Problems adding a COM component reference to a VB.NET project

I have a third party COM dll that I'm trying to add to a vb.net (2008 express) project. I put the dll in C:\WINDOWS\system32\ and registered it with "regsvr32 vxncom.dll". When I go to projects > add reference and go to the COM tab it shows up in the list of available components/libraries. But, when I select the library and hit ok, visua...

Good Intro to COM Programming

Is there a good book or website with a basic introduction to COM programming? I am using C++, but I am hoping for a good overview. ...

Future of the Component Object Model?

Folks, Please has anyone heard anything about Microsoft [not] supporting COM on future version of Windows? I imagine that Microsofts engineers are stuck with it (even if they would prefer to only develop and support the .NET framework) simply because of the enourmous backlash from there huge customer vase. There must be literally bill...

Is it possible to implement a COM interface with a .NET generics class?

I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export that to COM, but th...

How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?

How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows? To manually perform the operation I can follow the steps described in link text Open Device Manager with devmgmt.msc Double-click Ports (COM & LPT). Right-click the port I want, and then click Properties. On the Port Settings tab, if ...

Is it possible to call a COM API from Java?

Is it possible to call a COM API from Java (specifically the HP/Mercury Quality Center OTA API)? If so, what's the best way? Is something like JACOB appropriate? Code fragments would be helpful for the basics :-) ...

Get address of current page in Internet Explorer from toolbar

I'm trying to wrap my head around creating a toolbar (a tool band in a rebar) in MFC for Internet Explorer using COM. Is it possible to get the address of the currently viewed page (i.e., http://stackoverflow.com/questions/ask in my case :-) ) from the toolbar? If so, what should I look in to? Thanks! ...

Is there an embeddable Webkit component for Windows / C# development?

I've seen a few COM controls which wrap the Gecko rendering engine (GeckoFX, as well as the control shipped by Mozilla - mozctlx.dll). Is there a wrapper for Webkit that can be included in a .NET Winform application? ...

Why does regasm.exe register my c# assembly with the wrong GUID?

I've got a c# assembly which I'm invoking via COM from a Delphi (win32 native) application. This works on all the machines I've tested it on, except one. The problem is that the Delphi application gets "Class not registered" when trying to create the COM object. Now, when I look in the registry under HKEY_CLASSES_ROOT\DelphiToCSharp\C...

Problem using large binary segment in OOXML

System Description A plotting component that uses OOXML to generate a document. Plotting component consists of several parts. All parts are written in C++ as exe + dll's, with the exception of the interface to the OOXML document. The latter component is a COM component that was created in C#/.NET. The main reason for this is that the...

Which is correct? catch (_com_error e) or catch (_com_error& e)?

Which one should I use? catch (_com_error e) or catch (_com_error& e) ...