com

Which Model to use STA/MTA

Hi, I'm trying to create COM component, where it will be frequently call by a excel application (excel will load the COM at its initialization) and another process (let say procA) also sends (with high frequency) windows messages to this component. Currently I implemented COM as a STA, however, I experienced that while COM is busy with ...

How to retreve the Interface ID of a COM class so that It can be passed to CoCreateInstance?

I want to programaticly retreive the Interface ID for any or any class so that I can pass it to CoCreateInstance. Any help is very much so appreciated!! See "How Do I Get This" below: HRESULT hResult; CLSID ClassID; void *pInterface; if(!(hResult = SUCCEEDED(CoInitialize(NULL)))) { return 1; } if(S_OK == CLSIDFromProgID(OLESTR("S...

Easiest way to expose COM+ via web service

I have a COM+ object which is not stateless (it takes a while to initialize, and maintains large objects in RAM). I want to expose its functionality to other applications / hosts via web service or TCP/IP. I saw that COM+ Component Services have a built-in capability to create SOAP wrappers and attach them to IIS. However, it looks lik...

How to Store a VARIANT

Hi, I need to store a VARIANT of type bstr in a stl vector. I'm not sure how should I store VARIANT type in vector. vector<VARIANT> vec_MyVec; VARIANT var_Temp; VariantInit(&var_Temp); var_Temp.vt = VT_BSTR var_Temp.bstrVal = SysAllocString("Test"); vec_MyVec.push_back(var_Temp); Is this implementation cause a memor...

How Do I Get The Resource DLL Code Samples In The Windows SDKs To Compile And Run?

I am currently trying to build a Resource DLL on on Windows Server 2003 and 2008. I am currently working with the Resource DLL code samples supplied with the Windows SDKs, and I can't get them to work. On Windows Server 2008 I succeeded compiling the Windows 7 SDK ClipBook Server sample, but couldn't get it to properly work in the clust...

Dynamic array of COM objects

I have an ATL COM object which needs to expose a collection of other COM objects, so clients can find out how many objects are in the collection (via a simple Count property which I can provide) and access the objects using its index. This collection of objects is dynamic - the count is not fixed - and I don't know how many there will b...

C# usage in COM heavy application

I would like to use C# for an application I'm building, but the application makes heavy use of automation (i.e. Excel, Word). Is it feasible to use C# for such an application? It used to be a nightmare to use C type languages for things like parameter lists with null arguments etc.. What are some tips to make things easier or should I...

"Parameter is incorrect" error when invoking .NET assembly via COM component

Hello all! I have a .NET assembly that lives in the GAC. It is registered correctly so that it can be invoked by COM components. This .NET assembly contains a method and an overload to the method: public void Foo(string sValString, out string sOutString, string sOverloadString) { if( sOverloadString == string.Empty ) // d...

How does a .NET program behave differently when run with and without debugging in Visual Studio?

I'm getting an Access Violation in DBEXPSDA40.DLL (Dev Art MS SQL Server dbexpress driver) on closing down my .NET application. My application (VB.NET) calls a Delphi written COM Server which uses dbexpress to connect to SQL Server. If I do the same thing, but my host application is a native Delphi application, or Excel VBA, then I do n...

ATL Dll Fails to register with XP

Hi, I created a simple COM object with ATL VS 2008. I can successfully register the dll in my machine and use it. However, I tried to register the dll with a XP installed machine with no VS 2008 installed. But this does not seem to be work. Then, I installed the VC 2008 redistributable SP1, and tried. Still the registration is failed...

Your opinions on the SQLitePlus COM dll please

This is a dll sold by a company called ez tools software. Am wondering if you've used this component and what your experience was like in your dealing with them. The company website is somewhat unconventional but perhaps this is to be expected considering the underlying product is open source. Would really appreciate your opinion on t...

Single 32-bit MSI with 32/64-bit drivers

Is it possible to include difxapp_x86.wixlib or difxapp_x64.wixlib in same WiX setup to install a driver in both 32-bit and 64-bit machines? Background is that we have a setup which needs to be 32-bit regardless of the target platform (it's a .NET application which uses 32-bit COM components, so we must build .Net assemblies as x86). S...

Registering and using out-of-proc COM server in an isolated way (SxS)

Hi, We have the following configuration: IE->Creates new process->Process uses out-of-proc COM server We would like to enjoy side-by-side for our new process and out-of-proc COM server which are deployed in an isolated folder. We thought using COM registration with relative path but it looks that when trying to load the COM server, svc...

Convert IDispatch* to a string?

I am converting an old VB COM object (which I didn't write) to C++ using ATL. One of the methods, according to the IDL, takes an IDispatch* as a parameter and the documentation and samples for this method claim that you can pass either a string (which is the progid of an object that will be created and used by the control) or an IDispat...

What determines how long does an out of process COM server takes to notice that a client has died?

In a simple windows setup we have a COM singleton that runs as an out of process server. Clients connect by calling cocreate and each receives an interface to the same instance of the server. If clients shutdown normally they release their references. The server has a bit of logic that keeps it alive for a short time after the last re...

COM Exception 0x8004005

Hi, I have a C# web service that is calling COM objects to access a FileNet imaging system. The service is occasionally encountering the following error when making a call to the FileNet COM objects: System.Runtime.InteropServices.COMException (0x80040005): Need to run the object to perform this operation (Exception from HRESULT: 0x800...

CComSafeArray: Are Indices Really Reversed for MultiDimSetAt and MultiDimGetAt?

In the MSDN documentation for CComSafeArray::MultiDimSetAt, alIndex is documented as follows: Pointer to a vector of indexes for each dimension in the array. The rightmost (least significant) dimension is alIndex[0]. In the documentation for CComSafeArray::MultiDimGetAt, alIndex is documented differently: Pointer to a vector of...

Does CComSafeArray MultiDimSetAt Make a Copy of the Referenced Element?

The CComSafeArray::SetAt method provides a parameter to control whether the referenced variable is copied: HRESULT SetAt( LONG lIndex, const T& t, BOOL bCopy = TRUE ); ... but the CComSafeArray::MultiDimSetAt method does not offer the same parameter: HRESULT MultiDimSetAt( const LONG * alIndex, const T& t ); Two questions: 1.) Is...

COM Deployment for VISTA

Hi, What is the COM interface that need to be implemented in order to deploy COM dll in a vista/win7 machine. I heard that there is something to deal with UAC accounts with COM, but I could not find MSDN page for this, Please help. Thank you ...

Calling 32 binary from 64 bit application.

Hi, I am working on an application which is in 32 bit. This app is working fine in 32 bit machine . But when I install it in 64 bit machine it does not work properly. So we planned to compile it in 64 bit configuration. We could compile it and tried to run, It works properly. But problem is; we have a 3ed party library which is in 32 ...