com

Isolated (Reg Free) COM component behavior

Hi, I have a rather awkward situation. I have one small COM exposed component (let's call it SmallCOM) which is a (Delphi) win32 dll, which I use from a managed C# assembly (through COM). I have one big COM exposed component (let's call it BigCOM) which is a (Delphi) win32 dll, and which I use from the same managed c# assembly (throug...

How to work with a DATE type in a COM/ATL project

I've got an ATL method that takes a DATE type, which is really a double. I can't find the class/functions for this type. Does anyone know how to operate on this type? I just need to make it into something I can get into boost::gregorian::date (yyyy/mm/dd). Also, I would really like to know what this double represents. Thanks. ...

Weird error running com-exposed assembly

I am facing the following issue when deploying a com-exposed assembly to my client's. The COM component should be consummed by a vb6 application. Here's how it's done 1) I have one c# project which has a class with a couple of methods exposed to COM 2) The project has references to multiple assemblies 3) I compile the project, genera...

STAThread and Process output capture in c#

Hi: This is a strange problem I encountered. I have an window application written in c# to do testing. It has a MDI parent form that is hosting a few children forms. One of the forms launch test scripts by creating processes and capture the scripts output to a text box. Another form open serial port and monitoring the status of the devi...

Can the Windows Media Player COM control play AVI files from memory (instead of from a file)?

I have a C# app, and I'm looking at using the Windows Media Player COM control to play animation and audio. So far, the only way I see of programatically controlling what the control is playing is to set its URL property to point to some file (I assume there's some way to pass in a playlist). Is there any way the WMP can render an AVI ...

.NET Framework generates strange DCOM error

Hello, I am creating a simple application that enables merging of key-value pairs fields in a Word and/or Excel document. Until this day, the application has worked out just fine. I am using the latest version of .NET Framework 4.0 (since it provides a nice wrapper API for Interop). My sample merging method looks like this: public by...

Working with AfxWnd and AfxFrameOfView windows

Hello! As I know, this windows is MFC windows. How can I work with this windows (set text, get text, scroll and so on) using COM technology and any script language, for example VBS? ...

How can I register a DLL which I created in C++

I created a DLL in C++ using Visual Studio 2005. My problem is that I cannot register this DLL. Show me the error: "LoadLibrary(MyDll.dll) failed. The specified module could not be found." Someone help me? Thanks ...

How to prevent Windows from caching Com Class info?

Windows 7 is caching some of the COM class information. Older OSs didn't do this. After the OS looks up the HKCU\Software\Classes\CLSID{GUID}\LocalServer32 value, it caches the value, and doesn't look it up again. When we update our software, we place the new updates in a different directory, and then update the HKCU\Software\Classes\CL...

How to reliably replace a library-defined error handler with my own?

On certain error cases ATL invokes AtlThrow() which is implemented as ATL::AtlThrowImpl() which in turn throws CAtlException. The latter is not very good - CAtlException is not even derived from std::exception and also we use our own exceptions hierarchy and now we will have to catch CAtlException separately here and there which is lots ...

Why can't pass Marshaled interface as integer(or pointer)

I passed ref of interface from Visio Add-ins to MyCOMServer (http://stackoverflow.com/questions/2455183/interface-marshalling-in-delphi).I have to pass interface as pointer in internals method of MyCOMServer. I try to pass interface to internal method as pointer of interface, but after back cast when i try call method of interface I ge...

QueryInterface fails at casting inside COM-interface implementation

I am creating a tool in c# to retrieve messages of a CAN-network (network in a car) using an Dll written in C/C++. This dll is usable as a COM-interface. My c#-formclass implements one of these COM-interfaces. And other variables are instantiated using these COM-interfaces (everything works perfect). The problem: The interface my C#-fo...

Generic calls to OnResetDevice() and OnLostDevice()

This is kind of a COM question to do with DirectX. So, both ID3DXSprite and ID3DXFont and a bunch of the other ID3DX* objects require you to call OnLostDevice() when the d3d device is lost AND OnResetDevice() when the device is reset. What I want to do is maintain an array of all ID3DX* objects and simply call OnResetDevice() and OnLos...

How do I create interface methods using .tlb types in VS C++?

Background: The .TLB file contains interfaces written in language 'X'. I don't have .h, .idl, .tlh, or any other header files - just the .TLB file. Language 'X' does not export compatible .h, .idl, etc. I use the VS wizard to add an ATL simple object to my ATL project. I want to add a method to the interface of my simple ATL object ...

How to test COM object integrity automatically?

Every COM object must have integrity. In simplified terms this means that if an object implements 3 interfaces - A, B and C and I have A* pointer to the object I must be able to successfully QueryInterface() both B and C and having B I must be able to retrieve A and C and having C I must be able to retrieve A and B. Now my object implem...

What's the recommended implementation for hashing OLE Variants?

OLE Variants, as used by older versions of Visual Basic and pervasively in COM Automation, can store lots of different types: basic types like integers and floats, more complicated types like strings and arrays, and all the way up to IDispatch implementations and pointers in the form of ByRef variants. Variants are also weakly typed: th...

ATL CString or_bstr_t?

In our COM project, we need to choose between best string class implementation so that BSTR (used for COM interfaces) and elegant string class like CString provides many string manipulation APIs. Are there any better way to handle the strings and string operations so that it can be BSTR complaints as well as we can have naive CString op...

How to use MFC with ATL

Hi, I'm trying to write a COM EXE using ATL. I also have a MFC application. Both these applications would be run in local machines. Therefore, I don't need to run these two processes (COM EXE and MFC) separately. Can I create a single application (process) by combining these two applications ? Is there any possibility that I can embed...

WIX: COM unregistration when removing one of two programs

Hello, I am relatively new to WiX. It is a great tool, but I still need some time to learn it better. I have encountered a problem with registration and unregistration of a COM component. I have created installers for two applications, lets call them A and B. Both are using the same COM component. I have used the heat tool, as recommend...

TWebBrowser modal print dialog?

Hello all, I've found many ways to make the TWebBrowser show a modeless print dialog box, but how do I make it show a modal one? I would like to print an html page, that's why I need the modal dialog. I'd really appreciate your ideas on this one. Thanks! ...