idl

How do I share a constant between C# and C++ code?

送分小仙女□ 提交于 2019-12-18 04:09:54
问题 I'm writing two processes using C# and WCF for one and C++ and WWSAPI for the second. I want to be able to define the address being used for communication between the two in a single place and have both C# and C++ use it. Is this possible? The closest I've come is defining the constant in an IDL, then using MIDL and TLBIMP to get it into a DLL that can be consumed by C#. However this doesn't seem to expose the constant, or at least I can't figure out how to make it do so. Maybe it is limited

Setting up my ATL COM callback functions

寵の児 提交于 2019-12-13 23:23:45
问题 A follow-up to this question, I have the following CerberusNative.idl file (this is an ATL project written in Visual C++ which exposes a COM object): [ object, uuid(AECE8D0C-F902-4311-A374-ED3A0EBB6B49), nonextensible, pointer_default(unique) ] interface ICallbacks : IUnknown { [id(1)] HRESULT UserExit([in] int errorCode, [in] BSTR errorMessage); [id(2)] HRESULT UserAttemptingReconnection(); [id(3)] HRESULT UserReconnected(); }; [ object, uuid(B98A7D3F-651A-49BE-9744-2B1D8C896E9E), dual,

Failed to cast result of Marshal.GetActiveObject for COM interop wrapper

江枫思渺然 提交于 2019-12-13 21:50:26
问题 I'm struggling to work out how to access a COM interface provided by a C++ application and use it from a C# .NET application. I try to access my COM object (which is provided by a running process) from my C# app like this: object obj = Marshal.GetActiveObject("MyLibrary.Application"); MyLibrary.IMainApp app = (MyLibrary.IMainApp)obj; The value of obj is non-null, but when I try to cast it I get System.InvalidCastException . I tried implementing a custom wrapper and also linked against a DLL

Chaining methods of ATL/COM objects

本小妞迷上赌 提交于 2019-12-13 04:30:29
问题 In c++ we can easily set up method chaining in a class by designing methods returning *this. Would this be possible in an ATL/COM setting ? Let's say I have a simple ATL class MyOBj. I would like to know if chaining is possible in this context, and if so, what would be the idl signature of the method that would support chaining ? Simple examples would be appreciated ! (In fact, my methods are called from VBA for excel, and I would like to have chaining in that VBA context, as we have chaining

Avro RPC multiple Responders for one NettyServer

别等时光非礼了梦想. 提交于 2019-12-13 01:53:53
问题 I'm studying Avro RPC and I'm trying to create a simple example to better understand it. But I'm facing a difficulty: I can't run a server with more than one Responder , as the NettyServer constructor only allows me to use one: public NettyServer(Responder responder, InetSocketAddress addr) So, if I have more than one IDL, like this: @namespace("foo.bar") protocol FooProtocol { void foo(); } @namespace("foo.bar") protocol BarProtocol { void bar(); } I'm not able to add both to my NettyServer

_ptr or _var - which one use as a class field and why?

丶灬走出姿态 提交于 2019-12-12 15:30:57
问题 I have a class: class Impl1 : public POA_I1 { private : Impl2_var ob; public : Impl2_ptr get(); { return ob; } void set(::Impl2_ptr ob) { this->ob = ob; } }; I'm a litte bit confused about _ptr and _var . I read that MyObject_var The _var version of the object reference type acts as a handle toproxy in much the same way as a _ptr reference but also adds memory management. Like all _var types, a _var reference takes care of deallocating its underlying instance (in this case, the proxy instance

How to import IDL into Delphi?

与世无争的帅哥 提交于 2019-12-12 15:23:47
问题 How do i import an Interface Definition Language ( idl ) file into Delphi; converting the types and interfaces to a pascal file? I've tried: File , Open : it just shows the text of the .idl text file Project , Add to project : It just (acts like) it adds a .idl text file to the project Component , Install component , Import a Type Library , Add : But it causes a handled crash Component , Install component , Import ActiveX Control , Add : But it causes a handled crash using Embarcadero's

Syntax error while converting IDL to C header

别等时光非礼了梦想. 提交于 2019-12-12 11:46:02
问题 I am trying to get C header files for COM interfaces using OLE/COM object viewer. I have tries to save type library as header file in object viewer, however, after a cmd window flashes, nothing happens. I have tried to save it as IDL file and convert to header file myself using this command; midl /out C:\temp /header EXCEL.h EXCEL.IDL However, I am getting this error: Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555 Copyright (c) Microsoft Corporation. All rights reserved. 64 bit

compiling corba .idl file error

*爱你&永不变心* 提交于 2019-12-11 22:59:09
问题 Eclipse IDL compilation So im in the directory of the .idl file and I want to compile the gridDemo file, So I type idlj gridDemo.idl and I get the error that idlj is not a recognized as an internal or external command What am I doing wrong ? Yes Im running windows I have installed the java sdk, C:\Program Files (x86)\Java\jre7\bin Is this the path I put into the system variable path? SOLVED I was using the wrong file. it should have been the jdk not jre folder. Thanks very much :) 回答1: Update

DISPID_VALUE and varargs weird behaviour

三世轮回 提交于 2019-12-11 17:56:36
问题 I am getting really strange behaviour mixing DISPID_VALUE and varargs in IDL/C++/VBA. I have the following definitions in my IDL file [ uuid(78fc63e0-fdb5-11e1-a21f-0800200c9a66), dual ] interface IPyObj : IDispatch { // ... [propget, id(DISPID_VALUE)] HRESULT Item( [in] VARIANT* Key, [out, retval] VARIANT* Result ); // ... }; // ... [entry("PyTuple"), helpstring("Builds a Python tuple object"), vararg] HRESULT __stdcall PyTuple( [in] SAFEARRAY(VARIANT)* Elements, [out, retval] VARIANT*