com

Unmanaged C++ Garbage Collection help

I'm a .net programmer, without much experience with unmanaged code. I've been adding modifications and additions to an unmanaged project, and everything is functioning just fine. Can you give me some pointers as to what kind of code/objects I need to be concerned about in regard to garbage collection? TIA ...

How to get process handle of a local COM server?

I have an IUnknown pointer to a COM local (out of process) server in my Windows client application. Would like to get a handle to the window process that is running the local COM server. Any way to do this via COM without adding a new interface to the server to request the process handle? (I can't easily change the server). Why do I wa...

How do I use a COM object from C?

I have a DLL containing a COM object that I'm trying to use. I couldn't find any good explanations of how to do so with C. It would be much appreciated if you guys could redirect me to a tutorial or something. ...

Passing COM objects as parameters in C#

Given the following code, can someone explain why I can pass a COM object as a value parameter but not as a reference parameter? private void TestRelease() { Excel.Workbook workbook = excel.ActiveWorkbook; ReleaseVal(workbook); // OK ReleaseRef(ref workbook); // Fail } private void ReleaseVal(Object obj) { if (o...

Can I create a generalized method to release COM objects?

Given the following code, will the ReleaseCOMObj() method release the original COM object, or will it implicitly create a copy and release that? private void TestRelease() { Excel.Workbook workbook = excel.ActiveWorkbook; // do stuff ReleaseComObj(workbook); } private static void ReleaseComObj(Object obj) { if (obj != n...

VC++ thread marshalling and COM : The application called an interface that was marshalled for a different thread

Hi, My VC++ 2005 Dialog based application initializes a COM object in the dialog class and uses it in the worker thread. I called CoInitialize(NULL) At the start of the application and the at the start of the worker thread. But when a COM method is called the error "The application called an interface that was marshalled for a differe...

Is it possible to write a COM Server on aix?

Hi, Is there a way to write a COM server on aix. I tried using the j-interop, but it allows me to wrap a COM Server in java , but runs only on windows. How could i achive this on aix. Is it even possible. Thanks ...

accessing COM port using ASP.net : access denied

Hi, I've written a Generic Handler so I can access my server's COM port through javascript. I'm doing this, because I'm writing a Web Interface to an ESP-88 from BOSE, for internal use. The code must be configurable, and I added routines for both TCP/IP support and RS232. In a desktop app, the code runs fine, but in an ASP.net 4.0 App...

IPreviewHandler throws uncatchable exception

I've imported the COM interface IPreviewHandler into a WinForms app and am using it to display previews for various types of documents (I look up the GUID of the appropriate preview handler in the registry, then use Activator.CreateInstance(guid) to instantiate the specific COM class. This works wonderfully for the vast majority of file...

How to make .NET not to use registered TLB to marshal calls to COM methods?

Current configuration is: The main application is unmanaged. It contains DLL, containing TLB, which describes functions, exposed to COM model. To support ASMX web services, it loads .NET framework, and starts ASP.NET domain that serves web service calls. To serve web service calls, it needs data from the main application. So, we'r...

GlobalInterfacePointer passing using AfxBeginthread

Hi, I am using a worker thread inside a CDialog class. theApp.m_pWorkerThread = AfxBeginThread(Threadproc,this); Now I need to pass a global Inerface poiner to the worker thread so as to access a COM object from outside Can someone tell me the syntax to pass the GIT cookie and access it inside the thread. Thanks ...

Printing from Adobe with Citrix

Greetings, I've attempted to shrink the code down as much as I can. Basically we use the Adobe Acrobat standard 6 Com libraries to print. It works as well as any batch pdf print solution that I've seen, but I can't seem to make it work with Citrix. Citrix appears to remap the netowrk printing locations and I can't seem to make it wo...

Installing OpenXML File Converter

I have written a managed OpenXML file converter in c#, but I'm having trouble with the deployment. For deployment, I am using a VS Setup Project. I guess my first question is, I see some people using a Class Library and others using a Windows Application as the COM server. Is there a preference on either one? My converter has dependenc...

Fetching playlists from Windows Media Player throwing non-descriptive exception

I’m building a WPF application that needs to interface with Windows Media Player. Before making a call to get all my local playlists, I initialize the media player like so: Type mediaPlayerCoreType = Type.GetTypeFromCLSID(new Guid("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")); _mediaPlayerCore = System.Activator.CreateInstance(mediaPlayer...

Setting up references to registration-free (isolated) COM DLLs in VC++

I have two VC++ projects: ProjectB which depends on ProjectA. I would like ProjectB to access ProjectA through ProjectA's COM interface only. I added a reference in ProjectB's "Framework and References" property dialog which creates an Interop DLL. How do I set up this reference to be in isolation mode? Do I need to make any modificatio...

TargetInvocationException when handling a COM Event

I am developing a COM dll library, and I have a little vb.net (vs 2005) application just to test it. I had my object declared in the application as Private m_VarName As MyLib.CMyComClass So far, so good. But now, I need an event to inform the application of some things, so I implemented such event in the COM dll, and changed the...

.NET events to C++ COM client

Adam Nathan in his book ".NET and COM" demonstrates how to hook up events from a C# library to a COM client, but the client code is shown only with a VB sample--I need C++. The C# client implements the Phone class: [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface IPhoneEvents { [Dispid(1)] void Ring(); } publi...

C++ COM design. Composition vs multiple inheritance

I'm trying to embed a browser control in my application (IWebBrowser2). I need to implement IDispatch, IDocHostShowUI, IDocHostUIHandler etc to make this work. I am doing this in pure C++/Win32 api. I'm not using ATL, MFC or any other framework. I have a main class, called TWebf, that creates a Win32 window to put the browser control in...

Class table generated InprocServer32 value problem.

I'm installing an Active X control that contains some COM servers. I'm using InstallShield's COM Extract at Build option to generate the registry information. This results in a lot of entries in the Registry and Class tables. (The extracted information is pretty much the same using Wix). It appears that my COM Sever is correctly bein...

How can two applications/processes communicate by COM?

I'm looking for a way to ease the difficulty transferring data from one application/process to another. It's said to be better than UDP or TCP for communicating by processes in the same OS(windows xp here) . Can you provide some core code that illustrate this? ...