Page 1 of 1

How VST3PluginTestHost loads plugins

Posted: Fri Jun 12, 2020 1:23 pm
by obiwanjacobi
I am trying to get my plugin to load in VST3PluginTestHost.

I have created the folder structure as described in the docs for my plugin uses a lot of files:

Code: Select all

C:\Program Files\Common Files\VST3\Jacobi.Vst3.TestPlugin.vst3\Contents\x86_64-win\Jacobi.Vst3.TestPlugin.vst3
I've also tried to locate the VST3 folder in the plugin test host's app folder:

Code: Select all

C:\Program Files\Steinberg\VST3PluginTestHost\VST3\Jacobi.Vst3.TestPlugin.vst3\Contents\x86_64-win\Jacobi.Vst3.TestPlugin.vst3
When I point the validator.exe to my plugin .vst3 file, it is loaded and tested fine; not everything is implemented but there are no errors.
This causes me to believe that the plugin should at least load and show up.

Any suggestions would be appreciated.

Using Window 10 (latest)/64 bit (yes, my plugin is 64 bit too).

I would really expect the test host to be a little more verbose with what it's seeing and loading. I have changed the windows module loader source code in the sdk to be able to use the validator to trouble shoot loading issues. You'll find my version attached and you are free to use it as you see fit.

Altered module_win32.cpp load method:

Code: Select all

	bool load (const std::string& inPath, std::string& errorDescription) override
	{
		auto wideStr = StringConvert::convert (inPath);
		module = LoadLibraryW (reinterpret_cast<LPCWSTR> (wideStr.data ()));
		if (!module)
		{
			errorDescription = "Module not found at '" + inPath + "' (" + std::to_string(::GetLastError()) +")\r\n";

			filesystem::path p (inPath);
			auto filename = p.filename ();
			p /= "Contents";
			p /= architectureString;
			p /= filename;
			wideStr = StringConvert::convert (p.string ());
			module = LoadLibraryW (reinterpret_cast<LPCWSTR> (wideStr.data ()));
			if (!module)
			{
				// TODO: is there an API to get more information about the failure ?
				auto err = ::GetLastError();
				// TODO: ::FormatMessage();
				errorDescription += "Module not found at '" + p.string () + 
					"', GetLastError: "  + std::to_string(err);
				return false;
			}
			else 
			{
				errorDescription = "";
			}
		}
		
		...

Re: How VST3PluginTestHost loads plugins

Posted: Fri Jun 12, 2020 4:15 pm
by Arne Scheffler
Have you tried to use another name without twice ".vst3" parts in it?

Re: How VST3PluginTestHost loads plugins

Posted: Sat Jun 13, 2020 6:56 am
by obiwanjacobi
Okay, after some more experimentation using my enhanced validator.exe it turned out to be a problem with loading dependencies.
::LoadLibrary will not report a difference between unable to load the module itself, or one of its dependencies.

Interestingly enough the same 'loading mechanism' did work for VST2 plugins...?
Thanks.

PS: having multiple `.vst3` parts in the name does not seem to be a problem.