I am learning c++ and I am trying to better understand it. I was reading the msdn documents on how to use xml lite. it said that I must use a class that implements the IStream interface. It said to declare and instantiate my class that extends Istream and use CComPtr when declaring the varible. then it showed me the following.
CComPtr<I...
What is the difference between the two lines of code below:
CComPtr< IInterface > m_interface;
IInterface* m_interface;
I know that CComPtr help eliminate memory leaks, but I am getting inconsistent results. When declaring the pointer with CComPtr< IInterface > m_interface;
and using the interface in my C# code there are no errors, h...
I'm developing a COM server to be used from Excel VBA. When I update the server (edit code, unregister, re-register) Excel seems to carry on using the original version of the COM server, not the updated version. The only way I have found to get it to use the updated version is to close and re-open Excel, which gets a bit irritating. I...
I'm running Excel from a C# .Net application and having trouble getting the process to shut down. How can I get the Excel process to shut down correctly from my C# program?
...
I'm fiddling round with Excel interop at the moment.
Its all going smoothly and I'm disposing of the COM objects and everybody is happy.
What I'm wondering though is how I can reliably kill the COM object if my application crashes out?
Any suggestions welcome, I'm using C#
...
How do I determine if an object is a COM object? I need to call Marshal.FinalReleaseComObject on all COM objects in an array of type Object.
...
Since COM objects hold non-memory resources but don't support IDisposable, I'm trying out some ideas to fake it. What do you think of my first attempt?
Public Function ComBlock(ByVal ParamArray comObjects As Object()) As IDisposable
For i As Integer = 0 To comObjects.Length - 1
If comObjects(i) Is Nothing Then Throw New Argu...
Possible Duplicate:
Is .NET all COM underneath?
I heard a DotNetRocks interview where the guest made the statement that .NET was written in COM(It's all COM...). I'm curious if this is or is not true?
...
I created a ATL windows less control and the class definition is like this:
class ATL_NO_VTABLE CRSPClient :
public IObjectSafetyImpl<CRSPClient, INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA>,
public CComObjectRootEx<CComSingleThreadModel>,
public IDispatchImpl<IRSPClient, &IID_IRSPClient, &LIBID_a...
When you create a new C# project in Visual Studio, the generated AssemblyInfo.cs file includes an attribute specifying an assembly GUID. The comment above the attribute states that it is used "if this project is exposed to COM".
None of my assemblies contain types which need to be visible to COM, so I have marked my assembly with [assem...
Hi,
In C++ program the call to method of coclass returns the error 0x80010108 (The object invoked has disconnected from its clients). What may be the causes of that?
...
I am trying to launch an existing MS Access database (Access 2010) from a Silverlight 4 OOB with elevated authorisation set. I keep getting an error. I can create a new Access application using the CreateObject keyword, but when I try to launch an existing one I get an error: "No object was found registered for specified ProgID."
Any he...
I'm trying to make a program that would open new Outlook 2007 message.
I've referenced from COM tab Microsoft Outlook 12.0 ObjectLibrary.
These items showed up in references in VS:
Microsoft.Office.Core
Microsoft.Office.Inerop.Outlook
Now I try to invoke following code:
var _outlookInstance = new Microsoft.Office.Interop.Outlook.Ap...
The ADO Recordset code below do not return any records in the code below. The ADO Command object and the ADO Connection works fine against my Access 2010 beta db.
I can Insert records, but not retrieve any. Any help is greatly appreciated.
:)=
THIS WORKS:
string sMSAccess = "C:\\Users\\storltx\\Documents\\SL4Demo.accdb";
...
Hi,
Can somebody please explain how the memory allocation/de-allocation occurs when we passing values between COM object and VB.
My Concerns are:
1.
IMyInterface::Method1 ([in] BSTR* pVal, [in] SAFEARRAY(BSTR)* pArray);
do we need to free the allocated memory for above parameters inside COM object ?
2.
IMyInterface::Method2 ([in, ...
all the D3D interfaces are derived from COM's IUnknown interface, so I though I'd take an easy route for releasing D3D objects and use something like this:
__inline BOOL SafeRelease(IUnknown*& pUnknown)
{
if(pUnknown != NULL && FAILED(pUnknown->Release()))
return FALSE;
pUnknown = NULL;
return TRUE;
}
this doesn't...
Im writing a BHO for internet explorer where i need to call javascript methods on all open browser instances from a 'static' (or a 'global') callback method. I'm running into issues that i'm sure are related to multi-threading in COM. I had few general questions regarding this (i am new to windows programming!).
Every browser would hav...
hi,
I'm trying to pass a UDT as a parameter to a ATL event.
IProxy_MyInterface::OnMyATLEvent ([in] MyUDT* pVal);
I used the ATL wizard for generating code for the Event. However, in the generated code, the "pVal" is simply assign to a CComVariant. Also, when I compile the code, it shows a warning
: warning C4800: 'MyUDT *' : forcin...
I'm using CruiseControl.NET with MSTest to build my Excel add-in. Some of my tests involve opening Excel, performing some operations and checking the results. This is all achieved through COM.
If I run the tests from with Visual Studio 2008, they work perfectly. However, when the tests are started by CruiseControl, the Excel process ...
I use Unmanaged Exports to create a native .dll from .NET .dll so I can access .NET code from Delphi without COM registration.
For example I have this .NET assembly:
using System;
using System.Collections.Generic;
using System.Text;
using RGiesecke.DllExport;
using System.Runtime.InteropServices;
namespace DelphiNET
{
[ComVisible(t...