Hello everyone, recently I have been encountering problems with exposing events from .NET to COM.
I have been successful with this example (conceptually taken from http://blogs.msdn.com/andreww/archive/2008/10/13/exposing-events-from-managed-add-in-objects.aspx):
// The delegate type for our custom event.
[ComVisible(false)]
public de...
Hello,
I am trying to create a class that implements the IUnknown interface. I have the following code in the header file.
#pragma once
#include "stdafx.h"
#include "Unknwn.h"
class Vmr9Presenter : IVMRImagePresenter9, IVMRSurfaceAllocator9
{
public:
Vmr9Presenter(void);
HRESULT Initialize(void);
~Vmr9Presenter(void);
STDMETHODIMP ...
IUnknown::QueryInterface() is passed a void** parameter denoting an address where to put the retrieved interface.
STDMETHOD QueryInterface(/* [in] */ REFIID riid, /* [iid_is][out] */ void** ppvObject)
Should the implementation of QueryInterface() check this pointer for being null (and then immediately return E_POINTER) or just write t...
I know this may be a long shot so forgive me as I don't really know that much about COM.
Basically what I am trying to do is get the pointer to the IUnknown interface for a running application, the problem is the only thing I know about the app is its main window handle.
Would this be possible?
...
I have a legacy COM control (Core) that accepts an IUnknown to a sink. The purpose is to allow the Core to read/write data through this sink interface. The Core/Sink pointers are currently in use in legacy systems and are not easily modified.
The problem I'm having is when I attempt to call the Core from managed code and pass in an obje...
I'm trying to modify the behavior of an IDispatch interface already present in the system.
To do this my plan was to hook into the objects v-table during runtime and modify the pointers so it points to a custom hook method instead.
If I can get this to work I can add new methods and properties to already existing objects. Nice.
First I...
I am trying to separate Swapchain and Window creation from D3D10 device creation in my rendering framework meaning that I can't really use D3D10CreateDeviceAndSwapChain. I am running into an unexpected linker error when trying to build my test app.
I am including DXGI.h and linking to DXGI.lib as well as D3D10 libraries but nothing else...
In documentation (C++ example)
LUnknown* pIUnknown = CreateInstance(slot);
I try this
>> import ctypes
>> print type(ctypes.cdll.lcomp.CreateInstance(0))
<type 'int'>
How to get IUNKNOWN and QueryInterface?
...
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...
During the modification of an existing ATL COM object I came across an article from the "The Old New Thing" blog called "The ways people mess up IUnknown::QueryInterface" and there was a discussion in the comments section that started when one of the respondents (Norman Diamond) pointed out that that in one of the article's examples that...
In COM, when you want to create an instance of some COM Server object, do you first need to get a pointer to it's IUnknown interface and only then create a class object using CoGetClassObject?
As far as I understand it, IUnknown is used to manage object lifetimes, so from my understanding, whatever object the client wants to create, one...
Every time I build my C# Solution, I get a handful of warnings about interfaces that I've never seen or written. I tried Googling for some of them, but get no hits. Could these possibly be buried in an assembly I'm referencing? If so, is there any way to make these warnings go away?
Interface 'IAlertable' is marked as [dual], but ...
In Delphi, IUnknown is declared as:
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
Note: The output parameter is untyped
In my TInterfacedObject descendant i need to handle QueryInterface, so i can return an object that supports the requested interface:
function TFoo.QueryInterface(const IID: TGUID; out Obj): ...