DLL Import Errors


I’m really new to Unity and I try to load a c++ .dll into my unity script.

Heres my Problem.

The C++ Projekt have one Method in the .cpp:

    	bool Connect(string c_szAddr) {
    		return true;

And thats the .h Part:

extern "C" { __declspec(dllexport) bool Connect(string c_szAddr); }

Now I load the dll and try to pass a string value to my C++ Method:

        private static extern bool Connect(string c_szAddr);
        public void __cplusplusconnect(string name, string password)

If I use this function…I get a strange error:

And the Unity Editor Dies after this^^. The Strange Thing is, when I use my Method without any param…theres no error.
Thank you for any help.

I have found the problem

         bool Connect(string c_szAddr) {
             return true;

I don’t know why, but it CAN’T get the param as a string. Here it must be const char*…