How to support "IPlug Interface Support" in a host?

in this post I found, that a host needs to implement the IMessage class for some plugins. IConnectionPoint is present already in my case already, since PlugProvider::connectComponents () is already called on plugins which have more than one components and so they components are already connected;
And also this:

	FUnknownPtr<IConnectionPoint> iconnection(App_editController);
	if (iconnection)
	{
		DBG("iconnection=%llxh", (long long)iconnection.get());
	}

gives a non-zero pointer output. So IMessage obviously is already present.

In class IEditController in pluginterfaces\vst\ivsteditcontroller.h I implemented:
static DataExchangeReceiverHandler dataexchange;
which correctly compiles.

However, the VST3 Host Checker says IPlugInterfaceSupport not supported;
And it also does not show IDataExchangeHandler and IDataExchangeReceiver
to be supported, although
I followed the advice in public.sdk\source\vst\utility\dataexchange.h
to implement it in IAudioProcessor class in pluginterfaces\vst\ivstaudioprocessor.h

    class DataExchangeHandler;
	DataExchangeHandler* dataexchange = NULL;

I was not able to implement it as:
DataExchangeHandler dataexchange;
cause including dataexchange.h gave a lot of errors. Where do I need to include it?

So how do I support IPlugInterfaceSupport and IDataExchangeHandler ?

Thank you!

There is an implementation example here in the VST 3 SDK:
public.sdk/source/vst/hosting/pluginterfacesupport.cpp
You should add only the API your host is implementing…

Thank you for your answer.

What exactly is meant by supporting such an interface?

public.sdk/source/vst/hosting/pluginterfacesupport.cpp is part of my project and compiles fine.
And in hostclasses.cpp the CTOR of class HostApplication creates an instance of:
mPlugInterfaceSupport = owned (new PlugInterfaceSupport);
and mPlugInterfaceSupport contains a non-zero value afterwards;
Also if using without the “owned” statement same result.

But using
FUnknownPtr<IPlugInterfaceSupport> plugInterfaceSupport(&pluginContext);
yields (plugInterfaceSupport == NULL)
where Vst::HostApplication pluginContext; is defined in class App

And also the hostchecker still says, that this interface is not supported.

But
PlugInterfaceSupport* plugInterfaceSupportptr = pluginContext.getPlugInterfaceSupport();
returns the correct pointer to that interface…

then i also tried it this way:
in class PlugProvider :
IPtr<IPlugInterfaceSupport> pluginterface;

and in PlugProvider::setupPlugin :

const VST3::UID  uid(Vst::IPlugInterfaceSupport::iid);
pluginterface = factory.createInstance<IPlugInterfaceSupport>(uid);

All compile fine, but pluginterface .get() remains zero and hostchecker still does not find it. Same if using PlugInterfaceSupport instead of IPlugInterfaceSupport

Also I tried this in PlugProvider::setupPlugin :

Vst::HostApplication* host_app = (Vst::HostApplication*)hostContext;
pluginterface = host_app->getPlugInterfaceSupport();

it compiles, and it returns a non-zero address, but no success at all in hostchecker…
here the full results from the hostchecker:

Your host App is using Vst::HostApplication ?
did you check that this code is called:

PluginContextFactory::instance ().setPluginContext (this->unknownCast ());

to register the pluginContext…
You could set breakpoints in

tresult PLUGIN_API HostApplication::queryInterface

in order to check if the plugin calls it…

You could check the validator example.

Note:
if you use :

IPtr<PlugInterfaceSupport> mPlugInterfaceSupport;

you have to use owned (else you have memory leak):

mPlugInterfaceSupport = owned (new PlugInterfaceSupport);

finally I got support for PlugInterfaceSupport working in my host! Thank You!
setPluginContext was already called, but here in hostclasses.cpp in line 89 :

if (mPlugInterfaceSupport && mPlugInterfaceSupport->queryInterface (iid, obj) == kResultTrue)

iid” must be “_iid”, then IPlugInterfaceSupport is correctly queried and the hostchecker plugin shows it correctly:

Related to class DataExchangeHandler this sentence in dataexchange.h confused me:
[…]To use this, make an instance of DataExchangeHandler a member of your IAudioProcessor class[…]
Where in the SDK should I do the steps described here ?

hostchecker confirms that IDataExchangeReceiver is supported when the following code is executed:

FUnknownPtr<IDataExchangeReceiver> dataexchangeReceiver(App_editController);
if (dataexchangeReceiver) {  } // dataexchangeReceiver is not NULL

App_editController is of type IEditController* and so IDataExchangeReceiver already seems to be present in the original SDK, I did not add anything, but the interface is correctly found.