Questions tagged [queryinterface]
31 questions
2
votes
1 answer
Python, ArcObjects, and .AppRef: how to get from IAppROT to IMxDocument?
I am writing an external Python/comtypes script (in PythonWin) that needs to get a reference to the current ArcGIS 10.0 ArcMap session (through the ArcObjects COM). Because the script is outside the application boundary, I am getting the…

celticflute
- 121
- 4
2
votes
3 answers
Access violation after GetInterface/QueryInterface in Delphi
First, I'm very new in Delphi and COM, but I should build COM application in Delphi. I read a lot of articles and notes on the internets, but COM and COM in Delphi are still not clear to me.
My sources -…

Sergey Miryanov
- 1,820
- 16
- 29
1
vote
1 answer
Is calling QueryInterface() ever absolutely necessary in COM?
In this C++/COM shell extension tutorial, the programmer demonstrates (for purposes of edification) that you can forego calling QueryInterface() and simply pass around a general object instead. At least that works when implementing…
user9567282
1
vote
2 answers
Why is QueryInterface looking at two different COM projects for the same line of code?
Let me start off by saying I am VERY inexperienced with the workings of COM, but I have been tasked with debugging an issue for someone else
I have two COM projects named pvTaskCOM and pvFormsCOM and each has many Interfaces, but the two I am…

user3281826
- 277
- 1
- 2
- 8
1
vote
1 answer
QueryInterface for interface VBA._Collection failed
We are randomly seeing this error during long executions of our system. The error is caught by our alarm system, and we successfully retry, and continue running the system. The only hits we found on Google seem to mention corrupt installations. We…

mmk
- 19
- 1
1
vote
1 answer
Could QueryInterface() provide us with nullptr when succeed?
Imagine a situation:
CComPtr pGraph;
HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pGraph));
if (SUCCEEDED(hr))
{
CComPtr pControl;
hr =…

Illia Levandovskyi
- 1,228
- 1
- 11
- 20
1
vote
1 answer
Access violation exception from Delphi's Supports -> QueryInterface
I have the following piece of code:
for i := 0 to FControlList.Count - 1 do
if Supports(IMyControl(FControlList[i]), IMyControlEx) then
begin
MyControlEx := IMyControl(FControlList[i]) as IMyControlEx;
…

Sharon
- 83
- 1
- 9
1
vote
1 answer
QueryInterface method for the IID_IPersistStreamInit quit working
I have an application that I've been using to parse data from an HTML document. The application has been working for a few years until this week when the QueryInterface method for the IID_IPersistStreamInit started failing. The call to…
wqr
1
vote
1 answer
queryinterface for interface failed
I'm using an interop COM assembly in my 1.1 VB.NET code, and when I try to set a property of a class, I get an InvalidCastException with the message "QueryInterface for Interface … failed."
Any ideas on this?
Crios
1
vote
1 answer
Log calls to QueryInterface in managed COM server
I followed the example here to create a C# out-of-process COM server.
My server is used from a third-party application I don't have control over. In order to find out which interfaces they ask for when loading my component, I'd like to log all their…

Daniel Lang
- 6,819
- 4
- 28
- 54
0
votes
0 answers
Certain Firewall rules are not accessible using QueryInterface
I am trying to locate a specific rule in Firewall in c++ using the below code,
HRESULT WFCOMInitialize(INetFwPolicy2** ppNetFwPolicy2)
{
HRESULT hr = S_OK;
hr = CoCreateInstance(
__uuidof(NetFwPolicy2),
NULL,
…

Marshal Sebastian
- 315
- 3
- 15
0
votes
0 answers
pUnkSite->QueryInterface(IID_IOleWindow) fails with E_NOINTERFACE in my BHO
I use Microsoft Visual C++ and Windows 7.
I am developing IE toolbar with ATL and MFC. IE version is 11.0.9600.17420.
First of all, I have created COM object implementing IDeskBand and IObjectWithSite interfaces.
Second, I have implemented IDeskBand…

cls
- 501
- 1
- 5
- 18
0
votes
3 answers
Has anyone else noticed this behaviour in Delphi using QueryInterface?
Here are my types...
unit unitTestInterfaces;
interface
type
IFoo = interface
['{169AF568-4568-429A-A8F6-C69F4BBCC6F0}']
function TestFoo1:string;
function TestFoo:string;
end;
IBah = interface
…

RyanC
- 1
- 1
0
votes
1 answer
Getting the current inner window ID in a Firefox 32 extension
I'm trying to maintain a Firefox extension and it relies on getting the current inner window ID. In Firefox 31 the window object has a QueryInterface:
components/foo.js:
Foo.prototype = {
window: null,
...
init: function(aWindow) {
…

Chris
- 1
0
votes
1 answer
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…

brecht
- 41
- 2
- 7