On Mon, 11 Nov 2013 13:35:48 GMT, akaDemik wrote:

Good day.
Sorry for translate. English is not my native language.
I want to create a web interface for my non-D application.
I try to put "https://github.com/rejectedsoftware/vibe.d/tree/master/vibe.d/examples/diet" example into the dll.
After calling DllListenStart in main app i get Exception E0440001.
"Simple echo server" from http://vibed.org/docs works fine in dll.
Vibe.d can work within the dll. Or am I on the wrong way?

Exported function DllListenStart.

import vibe.appmain;
import vibe.http.server;
...
extern (Windows)
{
	void DllListenStart()
	{
		auto settings = new HTTPServerSettings;
		settings.port = 8888;
		settings.bindAddresses = ["::1", "127.0.0.1"];
		listenHTTP(settings, &handleRequest);
	}
}

package.json

...
"dependencies": {
	"vibe-d": "~master"
}
...

Thank you for help.

Did you call core.runtime.Runtime.initialize()/Runtime.terminate in DllMain? It's needed to set up the event driver and not doing this can result in an access violation (could be something else, too, though).

You'll also need to call vibe.core.core.runEventLoop somewhere to make the listenHTTP actually do something.